WIP: failing randomized test

SEED=175 MAX_PEERS=2 ITERATIONS=1 OPERATIONS=159 cargo test --package=collab random -- --nocapture
This commit is contained in:
Antonio Scandurra 2022-12-23 15:02:06 +01:00
parent 344d05045d
commit 6458a9144e
3 changed files with 15 additions and 1 deletions

1
Cargo.lock generated
View File

@ -4437,6 +4437,7 @@ dependencies = [
"aho-corasick", "aho-corasick",
"anyhow", "anyhow",
"async-trait", "async-trait",
"backtrace",
"client", "client",
"clock", "clock",
"collections", "collections",

View File

@ -37,6 +37,7 @@ util = { path = "../util" }
aho-corasick = "0.7" aho-corasick = "0.7"
anyhow = "1.0.57" anyhow = "1.0.57"
async-trait = "0.1" async-trait = "0.1"
backtrace = "0.3"
futures = "0.3" futures = "0.3"
ignore = "0.4" ignore = "0.4"
lazy_static = "1.4.0" lazy_static = "1.4.0"

View File

@ -4635,7 +4635,12 @@ impl Project {
let is_host = collaborator.replica_id == 0; let is_host = collaborator.replica_id == 0;
this.collaborators.insert(new_peer_id, collaborator); this.collaborators.insert(new_peer_id, collaborator);
if let Some(buffers) = this.shared_buffers.remove(&old_peer_id) { let buffers = this.shared_buffers.remove(&old_peer_id);
println!(
"peer {} became {}. moving buffers {:?}",
old_peer_id, new_peer_id, &buffers
);
if let Some(buffers) = buffers {
this.shared_buffers.insert(new_peer_id, buffers); this.shared_buffers.insert(new_peer_id, buffers);
} }
@ -5610,6 +5615,13 @@ impl Project {
) -> u64 { ) -> u64 {
let buffer_id = buffer.read(cx).remote_id(); let buffer_id = buffer.read(cx).remote_id();
if let Some(project_id) = self.remote_id() { if let Some(project_id) = self.remote_id() {
if buffer_id == 300015 {
println!(
"creating buffer for peer {}. {:?}",
peer_id,
backtrace::Backtrace::new()
);
}
let shared_buffers = self.shared_buffers.entry(peer_id).or_default(); let shared_buffers = self.shared_buffers.entry(peer_id).or_default();
if shared_buffers.insert(buffer_id) { if shared_buffers.insert(buffer_id) {
let buffer = buffer.read(cx); let buffer = buffer.read(cx);