Skip to content

Commit

Permalink
improve error message when a parallel process fails to report back
Browse files Browse the repository at this point in the history
  • Loading branch information
onsi committed Apr 26, 2022
1 parent 0976569 commit a7bd1fe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ginkgo/internal/run.go
Expand Up @@ -240,11 +240,13 @@ func runParallel(suite TestSuite, ginkgoConfig types.SuiteConfig, reporterConfig
case <-server.GetSuiteDone():
fmt.Println("")
case <-time.After(time.Second):
//the serve never got back to us. Something must have gone wrong.
fmt.Fprintln(os.Stderr, "** Ginkgo timed out waiting for all parallel procs to report back. **")
fmt.Fprintf(os.Stderr, "%s (%s)\n", suite.PackageName, suite.Path)
//one of the nodes never finished reporting to the server. Something must have gone wrong.
fmt.Fprint(formatter.ColorableStdErr, formatter.F("\n{{bold}}{{red}}Ginkgo timed out waiting for all parallel procs to report back{{/}}\n"))
fmt.Fprint(formatter.ColorableStdErr, formatter.F("{{gray}}Test suite:{{/}} %s (%s)\n\n", suite.PackageName, suite.Path))
fmt.Fprint(formatter.ColorableStdErr, formatter.Fiw(0, formatter.COLS, "This occurs if a parallel process exits before it reports its results to the Ginkgo CLI. The CLI will now print out all the stdout/stderr output it's collected from the running processes. However you may not see anything useful in these logs because the individual test processes usually intercept output to stdout/stderr in order to capture it in the spec reports.\n\nYou may want to try rerunning your test suite with {{light-gray}}--output-interceptor-mode=none{{/}} to see additional output here and debug your suite.\n"))
fmt.Fprintln(formatter.ColorableStdErr, " ")
for proc := 1; proc <= cliConfig.ComputedProcs(); proc++ {
fmt.Fprintf(os.Stderr, "Output from proc %d:\n", proc)
fmt.Fprintf(formatter.ColorableStdErr, formatter.F("{{bold}}Output from proc %d:{{/}}\n", proc))
fmt.Fprintln(os.Stderr, formatter.Fi(1, "%s", procOutput[proc-1].String()))
}
fmt.Fprintf(os.Stderr, "** End **")
Expand Down

0 comments on commit a7bd1fe

Please sign in to comment.