From 22522a3d296d7d18478c28afcfbc048fbed06280 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:36:11 +0000 Subject: [PATCH] test(storage-cassandra): widen the delays of the GSI pass test pass_reads_images_of_due_rows_only_and_reports_earliest_due failed once in CI at its setup check for phase 2. The earliest row of a worker partition was still one of account 0's rows, not one of account 2's. A row's delay is drawn between half the set delay and the full delay. Account 0's rows were due in 30 to 60 s, and account 2's rows, queued in phase 2, in 15 to 30 s. So account 2's rows were the earliest only when phase 2 started within about 15 s of account 0's rows. Between the two, the test runs the rest of phase 1's puts, two passes of every worker and the queue reads. On a loaded runner, that took longer. The test now sets 3,600 s for account 0, 7,200 s for account 1 and 300 s for account 2. The order of the three accounts is the same. Account 2's rows are the earliest as long as phase 2 starts within 1,500 s of account 0's rows. A pass reports the earliest queued row whatever its delay, so the rest of the test checks the same things. Fixes #990 --- .../tests/direct/gsi_worker_pass.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/storage-cassandra/tests/direct/gsi_worker_pass.rs b/crates/storage-cassandra/tests/direct/gsi_worker_pass.rs index 68bb4ef69..3ee4a5a5b 100644 --- a/crates/storage-cassandra/tests/direct/gsi_worker_pass.rs +++ b/crates/storage-cassandra/tests/direct/gsi_worker_pass.rs @@ -156,13 +156,17 @@ impl Fixture { /// earliest not-yet-due row of its partition across all account keyspaces. /// /// The three accounts are numbered in the order a pass reads them. -/// - Phase 1: account 0 holds one due row and rows due in 30 to 60 s. -/// Account 1 holds rows due in 60 to 120 s. The earliest rows are in +/// - Phase 1: account 0 holds one due row and rows due in 30 to 60 minutes. +/// Account 1 holds rows due in 60 to 120 minutes. The earliest rows are in /// account 0, which is not the last account a pass reads. -/// - Phase 2: account 2 gets rows due in 15 to 30 s. Its queue was empty, so +/// - Phase 2: account 2 gets rows due in 150 to 300 s. Its queue was empty, so /// no earlier row holds them back. The earliest rows are now in account 2, /// which is not the first account a pass reads. /// +/// The delays are far apart, so the order holds however long phase 1's puts, +/// passes and queue reads take on a loaded host: account 2's rows are the +/// earliest as long as phase 2 starts within 25 minutes of phase 1's rows. +/// /// So a pass that keeps the next due time of the last keyspace it reads fails /// phase 1, and a pass that keeps the first keyspace's fails phase 2. #[tokio::test] @@ -175,8 +179,8 @@ async fn pass_reads_images_of_due_rows_only_and_reports_earliest_due() { // Phase 1. f.queue(0, "due", 1, 1).await; tokio::time::sleep(std::time::Duration::from_millis(100)).await; - f.queue(0, "mid", ROWS_PER_BATCH, 60_000).await; - f.queue(1, "late", ROWS_PER_BATCH, 120_000).await; + f.queue(0, "mid", ROWS_PER_BATCH, 3_600_000).await; + f.queue(1, "late", ROWS_PER_BATCH, 7_200_000).await; let not_due_phase1 = 2 * ROWS_PER_BATCH; // The due row is applied in this pass; the rest stay queued. @@ -197,7 +201,7 @@ async fn pass_reads_images_of_due_rows_only_and_reports_earliest_due() { f.check_next_due("phase 1", &batches, 0).await; // Phase 2. - f.queue(2, "soon", ROWS_PER_BATCH, 30_000).await; + f.queue(2, "soon", ROWS_PER_BATCH, 300_000).await; let batches = f.pass_every_worker().await; let payload_rows_read: usize = batches.iter().map(|b| b.payload_rows_read).sum(); assert_eq!(