Skip to content

Commit

Permalink
roachtest: small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tbg committed Jan 10, 2025
1 parent 0e215a3 commit 8e7548f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/cmd/roachtest/tests/decommission.go
Original file line number Diff line number Diff line change
Expand Up @@ -1021,10 +1021,6 @@ func runDecommissionDrains(ctx context.Context, t test.Test, c cluster.Cluster)
require.NoError(t, err)
}

// Connect to node 4 (the target node of the decommission).
decommNodeDB := c.Conn(ctx, t.L(), decommNodeID)
defer decommNodeDB.Close()

// Decommission node 4 and poll its status during the decommission.
var (
maxAttempts = 50
Expand Down Expand Up @@ -1058,6 +1054,9 @@ func runDecommissionDrains(ctx context.Context, t test.Test, c cluster.Cluster)

// Check to see if the node has been drained or decommissioned.
// If not, queries should not fail.
// Connect to node 4 (the target node of the decommission).
decommNodeDB := c.Conn(ctx, t.L(), decommNodeID)
defer decommNodeDB.Close()
if err = run(decommNodeDB, `SHOW DATABASES`); err != nil {
if strings.Contains(err.Error(), "not accepting clients") || // drained
strings.Contains(err.Error(), "node is decommissioned") { // decommissioned
Expand Down

0 comments on commit 8e7548f

Please sign in to comment.