-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
roachtest: streamline debug collection #36562
Conversation
The case in which a test hit an error and the case in which a test times out were handled differently and I had little confidence that it was working as intended. This simplifies by not running the test in the main goroutine, but reserving the main goroutine for defering the debug and cleanup actions while the test itself is now running in a child goroutine. I tested this running `tpcc/nodes=3/w=headroom` locally (where it runs with one warehouse and only for a minute) in the passing case and in the case in which it fails with an artificially low timeout. Release note: None
} | ||
// NB: c.destroyed is nil for cloned clusters (i.e. in subtests). | ||
if !debugEnabled && c.destroyed != nil { | ||
c.Destroy(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS I'm unclear why there's this random c.Destroy
call that only fires on a timeout. Perhaps someone can educate me. I thought destroying would be left to a higher power. Perhaps we can just stop in all cases and don't need to track the bool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @tbg)
pkg/cmd/roachtest/test.go, line 1190 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
PS I'm unclear why there's this random
c.Destroy
call that only fires on a timeout. Perhaps someone can educate me. I thought destroying would be left to a higher power. Perhaps we can just stop in all cases and don't need to track the bool?
As I've mentioned to @andreimatei before, this code has evolved into the current mess and deserves to be rewritten, but there is a high probability of fallout from any changes.
pkg/cmd/roachtest/test.go, line 1230 at r1 (raw file):
t.mu.Unlock() // Run the test itself in a goroutine. The main goroutine is in charge
Does this muck with the test.runner
stacktrace magic? See test.decorate
. Also, test.runnerID
is supposed to be the ID of the goroutine running the test. See test.Status
, and test.Progress
. I suspect switching to running the test in a goroutine is going to have a bunch of fallout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not change the existing code any more. I'm trying to get my rewrite merged asap.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @tbg)
Inspired by 1.
The case in which a test hit an error and the case in which a test
times out were handled differently and I had little confidence that
it was working as intended.
This simplifies by not running the test in the main goroutine, but
reserving the main goroutine for defering the debug and cleanup
actions while the test itself is now running in a child goroutine.
I tested this running
tpcc/nodes=3/w=headroom
locally (where itruns with one warehouse and only for a minute) in the passing case
and in the case in which it fails with an artificially low timeout.
Release note: None