From 32a38ac8e4c5831e21db2e74c6f6827cbac0b59c Mon Sep 17 00:00:00 2001 From: maia Date: Mon, 30 Nov 2026 20:45:31 +0100 Subject: [PATCH] hive-priv: the egress lock test waits for a lock a forked child still shares --- hive-priv/src/egress.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hive-priv/src/egress.rs b/hive-priv/src/egress.rs index 8b8d6cc11..6fb75a9ae 100644 --- a/hive-priv/src/egress.rs +++ b/hive-priv/src/egress.rs @@ -2038,7 +2038,12 @@ mod tests { assert!(started.elapsed() >= Duration::from_millis(300)); assert!(started.elapsed() < Duration::from_secs(5)); drop(held); - lock_at(&path, Instant::now()).unwrap(); + // Taken within a few seconds, not at once: another test thread may be + // between `fork` and `exec` of a child (`run_bounded` tests), and until + // the `exec` closes the descriptor that child still shares the lock. + let freed = Instant::now(); + lock_at(&path, freed + Duration::from_secs(5)).unwrap(); + assert!(freed.elapsed() < Duration::from_secs(5)); let _ = std::fs::remove_file(&path); }