Don't block when emitting fs events

Blocking could happen while processing events, which would cause the
background scanner to never make any further progress.
This commit is contained in:
Antonio Scandurra 2022-03-01 13:08:25 +01:00
parent ce59e57e6d
commit 8d078ed4e2
3 changed files with 14 additions and 11 deletions

View file

@ -4185,7 +4185,9 @@ mod tests {
while operations.get() < max_operations {
cx.background().simulate_random_delay().await;
if clients.len() < max_peers && rng.lock().gen_bool(0.05) {
if clients.len() >= max_peers {
break;
} else if rng.lock().gen_bool(0.05) {
operations.set(operations.get() + 1);
let guest_id = clients.len();