From f1103c19cdde29b7c173c00b8110c2f7d1459f7b Mon Sep 17 00:00:00 2001 From: ahmadalguydi Date: Fri, 31 Jul 2026 06:35:57 +0300 Subject: [PATCH] test: explicitly release stale claim lock --- src/jobs.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jobs.rs b/src/jobs.rs index 3000dc7..4b1f218 100644 --- a/src/jobs.rs +++ b/src/jobs.rs @@ -5384,6 +5384,10 @@ printf '%s\n' '{"type":"thread.started","thread_id":"limited"}' let mut restarted = Ledger::open(&cfg.paths.database).unwrap(); restarted.recover_stale_runs(&cfg, 61_000).unwrap(); assert_eq!(restarted.state(&id), "running"); + // Release the OS lock explicitly before asking the restarted ledger + // to recover the claim. This keeps the test independent of when the + // file-handle destructor is observed by the runner. + lock._file.unlock().unwrap(); drop(lock); restarted.recover_stale_runs(&cfg, 62_000).unwrap();