aboutsummaryrefslogtreecommitdiffstats
path: root/src/simtest/remakes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/simtest/remakes.rs')
-rw-r--r--src/simtest/remakes.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/simtest/remakes.rs b/src/simtest/remakes.rs
index a063e2a..1c76520 100644
--- a/src/simtest/remakes.rs
+++ b/src/simtest/remakes.rs
@@ -231,11 +231,12 @@ async fn compaction_with_a_skewed_clock() {
assert_eq!(read(&b, "data").await, Some(json!(1)));
}
-/// Writes on a node right as it starts to rejoin (`Replica::writable`): each is either
-/// answered and kept, or refused; none lands in the fresh document before the epoch's
-/// snapshot, which every change of the new epoch descends from.
+/// Writes on a node through its rejoin: every one is answered and kept, those during
+/// the rejoin in the document before it (`StaleView`) and carried over at the end;
+/// none lands in the fresh document before the epoch's snapshot, which every change of
+/// the new epoch descends from.
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
-async fn writes_while_a_rejoin_starts_are_kept_or_refused() {
+async fn writes_through_a_rejoin_are_kept() {
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex};
@@ -257,9 +258,8 @@ async fn writes_while_a_rejoin_starts_are_kept_or_refused() {
let written = c
.mutate_doc(move |doc| store::write_path(doc, &at, &json!(n)))
.await;
- if written.is_ok() {
- answered.lock().unwrap().push(n);
- }
+ assert!(written.is_ok(), "write {n} refused: {written:?}");
+ answered.lock().unwrap().push(n);
n += 1;
tokio::time::sleep(Duration::from_millis(2)).await;
}
@@ -298,7 +298,7 @@ async fn writes_while_a_rejoin_starts_are_kept_or_refused() {
assert!(reached, "change {start} doesn't descend from the snapshot");
}
}
- // Every write answered is there (those before the rejoin replayed into it).
+ // Every write is there (those before and during the rejoin replayed into it).
let answered = answered.lock().unwrap().clone();
assert!(!answered.is_empty());
let c = &c;