Skip to content

Commit 0beff06

Browse files
committed
roachtest: skip latency verification for 2 mins after getting to steady state
This patch modifies the latency verifier to sleep for 2 minutes after detecting steady state (i.e. catchup scan/ initial scan completion), so a test doesn't flake after a temporary post catchup scan latency blip. Informs #156707 Release note: none
1 parent 930e2ef commit 0beff06

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pkg/cmd/roachtest/tests/cluster_to_cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,7 @@ func (rd *replicationDriver) main(ctx context.Context) {
12051205
if err := lv.pollLatencyUntilJobSucceeds(ctx, rd.setup.dst.db, ingestionJobID, time.Second, workloadDoneCh); err != nil {
12061206
// The latency poller may have failed because latency got too high. Grab a
12071207
// debug zip before the replication jobs spin down.
1208+
rd.t.L().Printf("latency monitor detected an error: %s", err)
12081209
rd.fetchDebugZip(ctx, rd.setup.src.nodes, "latency_source_debug.zip")
12091210
rd.fetchDebugZip(ctx, rd.setup.dst.nodes, "latency_dest_debug.zip")
12101211
return err

pkg/cmd/roachtest/tests/latency_verifier.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ func (lv *latencyVerifier) noteHighwater(highwaterTime time.Time) {
115115
}
116116
return
117117
}
118-
118+
justSwitchedToSteadyState := false
119119
if lv.targetSteadyLatency == 0 || latency < lv.targetSteadyLatency {
120+
if !lv.latencyBecameSteady {
121+
justSwitchedToSteadyState = true
122+
}
120123
lv.latencyBecameSteady = true
121124
}
122125
if !lv.latencyBecameSteady {
@@ -147,6 +150,10 @@ func (lv *latencyVerifier) noteHighwater(highwaterTime time.Time) {
147150
lv.name, latency.Truncate(time.Millisecond), lv.maxSeenSteadyLatency.Truncate(time.Millisecond), highwaterTime)
148151
lv.setTestStatus(update)
149152
}
153+
if justSwitchedToSteadyState {
154+
lv.logger.Printf("just reached steady state, sleeping for 2 minutes to ensure no temporary latency regressions")
155+
time.Sleep(2 * time.Minute)
156+
}
150157
}
151158

152159
// pollLatencyUntilJobSucceeds polls the changefeed latency until it is

0 commit comments

Comments
 (0)