diff --git a/pkg/cmd/roachtest/test_impl.go b/pkg/cmd/roachtest/test_impl.go index a7bf3d5d79a6..bbe98fcf744e 100644 --- a/pkg/cmd/roachtest/test_impl.go +++ b/pkg/cmd/roachtest/test_impl.go @@ -667,7 +667,10 @@ type workerStatus struct { ttr testToRunRes t *testImpl - c *clusterImpl + // The cluster that the worker is currently operating on. If the worker is + // currently running a test, the test is using this cluster. Nil if the + // worker does not currently have a cluster. + c *clusterImpl } } diff --git a/pkg/cmd/roachtest/test_runner.go b/pkg/cmd/roachtest/test_runner.go index d6bd91761e1f..47ab22424be8 100644 --- a/pkg/cmd/roachtest/test_runner.go +++ b/pkg/cmd/roachtest/test_runner.go @@ -752,6 +752,8 @@ func (r *testRunner) runWorker( c.Save(ctx, "cluster saved since --debug-always set", l) } + wStatus.SetCluster(c) + // Prepare the test's logger. Always set this up with real files, using a // temp dir if necessary. This simplifies testing. artifactsRootDir := lopt.artifactsDir @@ -874,7 +876,6 @@ func (r *testRunner) runWorker( c.goCoverDir = t.GoCoverArtifactsDir() - wStatus.SetCluster(c) wStatus.SetTest(t, testToRun) wStatus.SetStatus("running test")