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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-23 00:15:33 +02:00
commit e2dee7c16a

View file

@ -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();