Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

tbg
Copy link
Member

@tbg tbg commented Apr 5, 2019

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 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

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
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg tbg requested a review from andreimatei April 5, 2019 08:19
}
// NB: c.destroyed is nil for cloned clusters (i.e. in subtests).
if !debugEnabled && c.destroyed != nil {
c.Destroy(ctx)
Copy link
Member Author

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?

Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: 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.

Copy link
Contributor

@andreimatei andreimatei left a 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: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @tbg)

@tbg tbg added the X-noremind Bots won't notify about PRs with X-noremind label Jun 19, 2019
@tbg tbg closed this Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
X-noremind Bots won't notify about PRs with X-noremind
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants