From 00e8625037f9fb6a17577a66f46c5b53f3d85d8e Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 12 Jan 2023 14:30:10 -0800 Subject: [PATCH] Simplify management of entity ids for different app contexts in randomized test --- crates/collab/src/tests/randomized_integration_tests.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/collab/src/tests/randomized_integration_tests.rs b/crates/collab/src/tests/randomized_integration_tests.rs index 0c2f7ce288..0b6ec2367a 100644 --- a/crates/collab/src/tests/randomized_integration_tests.rs +++ b/crates/collab/src/tests/randomized_integration_tests.rs @@ -105,7 +105,6 @@ async fn test_random_collaboration( let mut clients = Vec::new(); let mut client_tasks = Vec::new(); let mut operation_channels = Vec::new(); - let mut next_entity_id = 100000; loop { let Some((next_operation, skipped)) = plan.lock().next_server_operation(&clients) else { break }; @@ -115,7 +114,6 @@ async fn test_random_collaboration( &mut clients, &mut client_tasks, &mut operation_channels, - &mut next_entity_id, plan.clone(), next_operation, cx, @@ -323,7 +321,6 @@ async fn apply_server_operation( clients: &mut Vec<(Rc, TestAppContext)>, client_tasks: &mut Vec>, operation_channels: &mut Vec>, - next_entity_id: &mut usize, plan: Arc>, operation: Operation, cx: &mut TestAppContext, @@ -341,15 +338,15 @@ async fn apply_server_operation( username = user.username.clone(); }; log::info!("Adding new connection for {}", username); - *next_entity_id += 100000; + let next_entity_id = (user_id.0 * 10_000) as usize; let mut client_cx = TestAppContext::new( cx.foreground_platform(), cx.platform(), - deterministic.build_foreground(*next_entity_id), + deterministic.build_foreground(user_id.0 as usize), deterministic.build_background(), cx.font_cache(), cx.leak_detector(), - *next_entity_id, + next_entity_id, cx.function_name.clone(), );