hive-priv: the egress lock test waits for a lock a forked child still shares
This commit is contained in:
parent
d5f5ee21be
commit
32a38ac8e4
1 changed files with 6 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue