Watch
0
0
Fork
You've already forked hyperhive
0

hive-priv: the egress lock test waits for a lock a forked child still shares

This commit is contained in:
maia 2026-11-30 20:45:31 +01:00 • committed by mara
commit 32a38ac8e4

View file

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