From 0559484843bc19e03236044aa463a3aba070193b Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Mon, 16 Aug 2021 16:14:25 +0200 Subject: [PATCH 1/2] roachtest: avoid NPE on cluster creation retries exceeded Release note: None --- pkg/cmd/roachtest/cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/roachtest/cluster.go b/pkg/cmd/roachtest/cluster.go index 4c6dba4eeab5..0d99ad60cbc2 100644 --- a/pkg/cmd/roachtest/cluster.go +++ b/pkg/cmd/roachtest/cluster.go @@ -886,7 +886,7 @@ func (f *clusterFactory) newCluster( c.Destroy(ctx, closeLogger, l) if i > maxAttempts { // Here we have to release the alloc, as we are giving up. - c.destroyState.alloc.Release() + cfg.alloc.Release() return nil, err } // Try again to create the cluster. From 373120f4ed3cf34bedbaca0871f9af7b164707e8 Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Mon, 16 Aug 2021 16:18:09 +0200 Subject: [PATCH 2/2] roachtest: expose cluster create retries in log file names Release note: None --- pkg/cmd/roachtest/cluster.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/roachtest/cluster.go b/pkg/cmd/roachtest/cluster.go index 0d99ad60cbc2..a40b2f29104f 100644 --- a/pkg/cmd/roachtest/cluster.go +++ b/pkg/cmd/roachtest/cluster.go @@ -856,7 +856,11 @@ func (f *clusterFactory) newCluster( } // Logs for creating a new cluster go to a dedicated log file. - logPath := filepath.Join(f.artifactsDir, runnerLogsDir, "cluster-create", c.name+".log") + var retryStr string + if i > 0 { + retryStr = "-retry" + strconv.Itoa(i) + } + logPath := filepath.Join(f.artifactsDir, runnerLogsDir, "cluster-create", c.name+retryStr+".log") l, err := logger.RootLogger(logPath, teeOpt) if err != nil { log.Fatalf(ctx, "%v", err)