@@ -54,17 +54,7 @@ func runClockJump(ctx context.Context, t test.Test, c cluster.Cluster, tc clockJ
5454 // test is done to pacify the dead node detector. Do this after the
5555 // clock offset is reset or the node will crash again.
5656 var aliveAfterOffset bool
57- defer func () {
58- offsetInjector .recover (ctx , c .Spec ().NodeCount )
59- // Resetting the clock is a jump in the opposite direction which
60- // can cause a crash even if the original jump didn't. Wait a few
61- // seconds before checking whether the node is alive and
62- // restarting it if not.
63- time .Sleep (3 * time .Second )
64- if ! isAlive (db , t .L ()) {
65- c .Start (ctx , t .L (), option .DefaultStartOpts (), install .MakeClusterSettings (), c .Node (1 ))
66- }
67- }()
57+
6858 defer offsetInjector .recover (ctx , c .Spec ().NodeCount )
6959 offsetInjector .offset (ctx , c .Spec ().NodeCount , tc .offset )
7060
@@ -76,6 +66,13 @@ func runClockJump(ctx context.Context, t test.Test, c cluster.Cluster, tc clockJ
7666 if aliveAfterOffset != tc .aliveAfterOffset {
7767 t .Fatalf ("Expected node health %v, got %v" , tc .aliveAfterOffset , aliveAfterOffset )
7868 }
69+
70+ // Resetting the clock is a jump in the opposite direction which can cause a
71+ // crash even if the original jump didn't. Since we do not control when
72+ // exactly the clock jumps, we simply stop and wipe the node (which also
73+ // prevents the post-test assertions from complaining about a down node).
74+ c .Wipe (ctx , c .All ())
75+ offsetInjector .recover (ctx , c .Spec ().NodeCount )
7976}
8077
8178type clockJumpTestCase struct {
0 commit comments