Skip to content

Commit 48a77a4

Browse files
committed
test(wal): reduce filler row count in crash truncation test
Fewer, larger filler rows seal the same number of WAL segments with far fewer fsync round-trips, speeding up the test on slow CI disks.
1 parent e5e3278 commit 48a77a4

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

nodedb/tests/crash_wal_truncation.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@ const CHECKPOINT_INTERVAL_SECS: &str = "2";
4444
/// rotation.
4545
const WAL_SEGMENT_TARGET_MB: &str = "1";
4646

47-
/// Filler payload per row. Large enough that a few dozen rows clear several
48-
/// 1 MiB segments, small enough to stay far under the 64 MiB WAL record cap.
49-
const FILLER_VALUE_BYTES: usize = 64 * 1024;
47+
/// Filler payload per row — deliberately large so the whole segment-sealing
48+
/// filler is a handful of writes, not dozens. Each filler INSERT is its own
49+
/// WAL fsync round-trip against a spawned (unoptimized) server, so a few big
50+
/// rows are dramatically faster than many small ones on a slow CI disk while
51+
/// sealing the same number of segments. Stays under the 1 MiB segment target
52+
/// (so one record fits in a segment) and far under the 64 MiB WAL record cap.
53+
const FILLER_VALUE_BYTES: usize = 512 * 1024;
5054

5155
/// ~2.5 MiB of filler over a 1 MiB segment target: enough to seal at least two
5256
/// segments, so the canary's segment is sealed and strictly below the active
5357
/// one no matter where the boot records happened to land.
54-
const FILLER_ROWS: usize = 40;
58+
const FILLER_ROWS: usize = 5;
5559

5660
/// How long to wait for the checkpoint to unlink the canary's segment. Several
5761
/// times the checkpoint interval, but bounded: a timeout here means truncation

0 commit comments

Comments
 (0)