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: log teardown to different file #54687

Merged
merged 1 commit into from
Sep 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkg/cmd/roachtest/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,21 @@ func (r *testRunner) runTest(
t.spec.Run(runCtx, t, c)
}()

teardownL, err := c.l.ChildLogger("teardown", quietStderr, quietStdout)
if err != nil {
return false, err
}
select {
case <-done:
s := "success"
if t.Failed() {
s = "failure"
}
c.l.Printf("tearing down after %s; see teardown.log", s)
l, c.l, t.l = teardownL, teardownL, teardownL
case <-time.After(timeout):
c.l.Printf("tearing down after timeout; see teardown.log")
l, c.l, t.l = teardownL, teardownL, teardownL
// Timeouts are often opaque. Improve our changes by dumping the stack
// so that at least we can piece together what the test is trying to
// do at this very moment.
Expand Down