mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-07 11:11:30 +00:00
Add logging in random concurrent edits test
This commit is contained in:
parent
bef93b319c
commit
e021154852
1 changed files with 14 additions and 4 deletions
|
@ -3131,9 +3131,13 @@ mod tests {
|
||||||
mutation_count -= 1;
|
mutation_count -= 1;
|
||||||
}
|
}
|
||||||
71..=100 if network.has_unreceived(replica_id) => {
|
71..=100 if network.has_unreceived(replica_id) => {
|
||||||
buffer
|
let ops = network.receive(replica_id, &mut rng);
|
||||||
.apply_ops(network.receive(replica_id, &mut rng), None)
|
log::info!(
|
||||||
.unwrap();
|
"Peer {} applying {} ops from the network.",
|
||||||
|
replica_id,
|
||||||
|
ops.len()
|
||||||
|
);
|
||||||
|
buffer.apply_ops(ops, None).unwrap();
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
});
|
});
|
||||||
|
@ -3393,7 +3397,12 @@ mod tests {
|
||||||
let (old_ranges, new_text, operation) = self.randomly_edit(rng, 5, cx.as_deref_mut());
|
let (old_ranges, new_text, operation) = self.randomly_edit(rng, 5, cx.as_deref_mut());
|
||||||
let mut operations = vec![operation];
|
let mut operations = vec![operation];
|
||||||
|
|
||||||
log::info!("Mutating buffer at {:?}: {:?}", old_ranges, new_text);
|
log::info!(
|
||||||
|
"Mutating buffer {} at {:?}: {:?}",
|
||||||
|
self.replica_id,
|
||||||
|
old_ranges,
|
||||||
|
new_text
|
||||||
|
);
|
||||||
|
|
||||||
// Randomly add, remove or mutate selection sets.
|
// Randomly add, remove or mutate selection sets.
|
||||||
let replica_selection_sets = &self
|
let replica_selection_sets = &self
|
||||||
|
@ -3428,6 +3437,7 @@ mod tests {
|
||||||
let mut ops = Vec::new();
|
let mut ops = Vec::new();
|
||||||
for _ in 0..rng.gen_range(1..5) {
|
for _ in 0..rng.gen_range(1..5) {
|
||||||
if let Some(edit_id) = self.history.ops.keys().choose(rng).copied() {
|
if let Some(edit_id) = self.history.ops.keys().choose(rng).copied() {
|
||||||
|
log::info!("Undoing buffer {} operation {:?}", self.replica_id, edit_id);
|
||||||
ops.push(self.undo_or_redo(edit_id).unwrap());
|
ops.push(self.undo_or_redo(edit_id).unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue