-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
roachtest: observe ctx cancellation in Run
Before this patch, roachprod invocations would not observe ctx cancellation. Or rather they would, but due to the usual obscure passing of Stdout into the child process of roachprod the Run call would not return until the child had finished. As a result, the test would continue running, which is annoying and also costs money. Also fixes up the handling of calling `c.t.Fatal` on a monitor goroutine (using what is perhaps unspecified behavior of the Go runtime). Anyway, the result is that you can do basically whatever inside of a monitor and get away with it: ```go m.Go(func(ctx context.Context) error { // Make sure the context cancellation works (not true prior to the PR // adding this test). return c.RunE(ctx, c.Node(1), "sleep", "2000") }) m.Go(func(ctx context.Context) error { // This will call c.t.Fatal which also used to wreak havoc on the test // harness. Now it exits just fine (and all it took were some mean hacks). // Note how it will exit with stderr and stdout in the failure message, // which is extremely helpful. c.Run(ctx, c.Node(1), "echo foo && echo bar && notfound") return errors.New("impossible") }) m.Wait() ``` now returns ``` --- FAIL: tpmc/w=1/nodes=3 (0.24s) ...,errgroup.go:58: /Users/tschottdorf/go/bin/roachprod run local:1 -- echo foo && echo bar && notfound returned: stderr: bash: notfound: command not found Error: exit status 127 stdout: foo bar : exit status 1 ...,tpcc.go:661: Goexit() was called FAIL ``` Release note: None
- Loading branch information
Showing
6 changed files
with
197 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule vendor
updated
4 files
+22 −0 | github.com/armon/circbuf/.gitignore | |
+20 −0 | github.com/armon/circbuf/LICENSE | |
+28 −0 | github.com/armon/circbuf/README.md | |
+92 −0 | github.com/armon/circbuf/circbuf.go |