#629

core: statefile lock test flakes on a slow CI runner

Openwiiiimmopened 12d ago

statefile::tests::the_lock_file_is_0600_and_serialises_read_modify_write failed once in CI (the test job on stealth-factory/opscope#652) and passed on a rerun. The same commit passed it in the debian and macos jobs.

Cause

Four threads take the lock 25 times each, and every write fsyncs. Each waits at most 300 × 10 ms = 3 s for the lock, then gives up; the .unwrap() then panics. On a slow runner, with no fair schedule, one thread can wait longer than that.

The test checks that no update is lost and that the lock file is 0600. It does not check how soon a lock frees. So the wait is not what it tests, and it should not fail on it.

Fix

Give the test 6000 tries (60 s). The widget's own half-second wait is unchanged.

Activity

1
linear-code[bot]12d ago