Skip to content

Commit 79faae8

Browse files
fix: deflake //rs/state_layout:state_layout_test (#9203)
## Root Cause The `checkpoints_files_are_removed_after_flushing_removal_channel` test creates 20 checkpoints with 500 dummy files each (10,000 files total), then removes 19 of them (9,500 file deletions) through the async removal channel. On busy CI machines with limited I/O bandwidth, this excessive file I/O causes the entire test binary to exceed its timeout. The 500 files per checkpoint were intended to create backlog in the checkpoint removal channel, so that we can do some assertions while the backlog is still clearing (namely that the checkpoint is no longer in the list of verified checkpoints), and other assertions after it is cleared (namely that the files are deleted from disk). ## Fix Reduce the dummy file count from 500 to 50 per checkpoint. This drops total file I/O from ~10,000 to ~1000 files. It strikes a balance between ensuring that the backlog definitely didn't clear before the assertion and overall I/O load. If this reduction is not enough, then we can consider adding artificial blockers to the backlog, but it seems not necessary for this test atm. --- This PR was created following the steps in `.claude/skills/fix-flaky-tests/SKILL.md`. --------- Co-authored-by: Stefan Schneider <31004026+schneiderstefan@users.noreply.github.com>
1 parent 3259804 commit 79faae8

File tree

1 file changed

+2
-3
lines changed
  • rs/state_layout/src/state_layout

1 file changed

+2
-3
lines changed

rs/state_layout/src/state_layout/tests.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,8 @@ fn checkpoints_files_are_removed_after_flushing_removal_channel() {
446446
)
447447
.unwrap();
448448

449-
// Write 500 dummy files to the scratchpad directory so that removing checkpoint files takes longer than dropping a `CheckpointLayout`.
450-
// This is to create some backlog in the checkpoint removal channel.
451-
for i in 0..500 {
449+
// Write a few dummy files to each checkpoint directory.
450+
for i in 0..50 {
452451
let file_path = scratchpad_layout.raw_path().join(i.to_string());
453452
File::create(file_path).unwrap();
454453
}

0 commit comments

Comments
 (0)