Save server operations that were in the middle of being applied

Previously, if the test panicked before it had a chance to fully
apply an operation, it would end up not being saved in the plan.
With this commit we will mark the operation as applied before we
start processing it, and mark it as not applied if, once we're done,
we've found out that it couldn't be applied. This is consistent with
what we do for client operations.
This commit is contained in:
Antonio Scandurra 2023-04-06 16:02:16 +02:00
parent f995d07542
commit 4a61e2dfa4

View file

@ -121,6 +121,7 @@ async fn test_random_collaboration(
loop {
let Some((next_operation, applied)) = plan.lock().next_server_operation(&clients) else { break };
applied.store(true, SeqCst);
let did_apply = apply_server_operation(
deterministic.clone(),
&mut server,
@ -132,8 +133,8 @@ async fn test_random_collaboration(
cx,
)
.await;
if did_apply {
applied.store(true, SeqCst);
if !did_apply {
applied.store(false, SeqCst);
}
}