From e2dee7c16a96e179116e6429cb43f081eed3b401 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 23 Oct 2026 00:15:33 +0200 Subject: [PATCH] idunn-launch tests: the inherited lease lock must stay held for a second, so a concurrent fork cannot mask a missing descriptor Builds. Co-Authored-By: Claude Sonnet 5.5 --- src/launcher.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/launcher.rs b/src/launcher.rs index 6c72c0b..689c35a 100644 --- a/src/launcher.rs +++ b/src/launcher.rs @@ -2630,8 +2630,13 @@ mod tests { .unwrap(); // The launcher dies: its own descriptor goes with it. drop(guard); - let denial = idunn.revoke_exact(Some(&lease)).unwrap_err(); - assert!(denial.to_string().contains("shared-lock consumer"), "the child does not hold the lock"); + // Held for a full second: a fork of some other test could pin the lock + // for an instant, only the child under test keeps it that long. + for _ in 0..10 { + let denial = idunn.revoke_exact(Some(&lease)).unwrap_err(); + assert!(denial.to_string().contains("shared-lock consumer"), "the child does not hold the lock"); + thread::sleep(Duration::from_millis(100)); + } child.terminate(Duration::from_secs(5)); wait_until("child gone", || child.exited().is_some()); idunn.revoke_exact(Some(&lease)).unwrap();