Skip to content

Commit

Permalink
roachtest: update disk-stall roachtests to wait for uprepl first
Browse files Browse the repository at this point in the history
This reduces the amount of work.

Informs #98904.
Epic: None
Release note: None
  • Loading branch information
jbowens committed Mar 20, 2023
1 parent b26a135 commit b2855fd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/cmd/roachtest/tests/disk_stall.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,22 @@ func runDiskStalledDetection(
require.NoError(t, err)
adminURL := adminUIAddrs[0]

c.Run(ctx, c.Node(4), `./cockroach workload init kv --splits 1000 {pgurl:1}`)
// Open SQL connections—one to n1, the node that will be stalled, and one to
// n2 that should remain open and active for the remainder.
n1Conn := c.Conn(ctx, t.L(), 1)
defer n1Conn.Close()
n2conn := c.Conn(ctx, t.L(), 2)
defer n2conn.Close()
require.NoError(t, n1Conn.PingContext(ctx))
_, err = n2conn.ExecContext(ctx, `USE kv;`)
require.NoError(t, err)

// Wait for upreplication.
require.NoError(t, WaitFor3XReplication(ctx, t, n2conn))

c.Run(ctx, c.Node(4), `./cockroach workload init kv --splits 1000 {pgurl:1}`)

_, err = n2conn.ExecContext(ctx, `USE kv;`)
require.NoError(t, err)

t.Status("starting workload")
workloadStartAt := timeutil.Now()
m := c.NewMonitor(ctx, c.Range(1, 3))
Expand Down

0 comments on commit b2855fd

Please sign in to comment.