Skip to content

Commit

Permalink
Test run: Don't print summary if interrupted via CTRL+C (SIGINT) (#564)
Browse files Browse the repository at this point in the history
Its potentially confusing if we print the summary despite the run having
been interrupted, since the summary will show "context canceled" errors
that someone not familiar with Go terminology won't understand.

Instead, don't print anything, so its more clear the program was stopped
in the middle of its work.
  • Loading branch information
lfittl authored Jul 11, 2024
1 parent 687ea5a commit 6403715
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ func run(ctx context.Context, wg *sync.WaitGroup, globalCollectionOpts state.Col
doLogTest(ctx, servers, globalCollectionOpts, logger)
}

selftest.PrintSummary(servers, logger.Verbose)
if ctx.Err() == nil {
selftest.PrintSummary(servers, logger.Verbose)
}
success := allFullSuccessful && allActivitySuccessful
if success {
fmt.Fprintln(os.Stderr, "Test successful")
Expand Down

0 comments on commit 6403715

Please sign in to comment.