Skip to content

Commit

Permalink
roachtest: deflake c2c driver
Browse files Browse the repository at this point in the history
PR cockroachdb#105635 fixed some leaky goroutines in the c2c driver, but also revealed a
new bug where a monitor was inadvertently watching the workload node. The
workload node shuts down before the monitor, causing the monitor to fail and
the test to flake. This patch prevents this monitor from watching the workload
node, fixing the infra flake.

Fixes cockroachdb#105595
Fixes cockroachdb#105603
Fixes cockroachdb#105600
  • Loading branch information
msbutler committed Jun 28, 2023
1 parent d45c830 commit 9a38aed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/cmd/roachtest/tests/cluster_to_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -834,17 +834,18 @@ func registerClusterToCluster(r registry.Registry) {
func(ctx context.Context, t test.Test, c cluster.Cluster) {
rd := makeReplicationDriver(t, c, sp)
rd.setupC2C(ctx, t, c)
m := rd.newMonitor(ctx)

m := c.NewMonitor(ctx)
hc := roachtestutil.NewHealthChecker(t, c, rd.crdbNodes())
m.Go(func(ctx context.Context) error {
require.NoError(t, hc.Runner(ctx))
return nil
})
defer hc.Done()

defer func() {
hc.Done()
m.Wait()
}()
rd.main(ctx)
m.Wait()
})
}
}
Expand Down

0 comments on commit 9a38aed

Please sign in to comment.