Skip to content

Commit

Permalink
make it deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ten0 committed May 25, 2024
1 parent 10a8a86 commit cfdeff6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scylla/tests/integration/shard_aware_batching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,17 @@ async fn run_test(
)
});

// Take a global lock to make test deterministic
// (and because we need to push stuff in there to test that shard-awareness is respected)
let mut shards_for_nodes_test_check =
shards_for_nodes_test_check_clone.lock().await;

session
.batch(&scylla_batch, &batch)
.await
.expect("Query to send batch failed");

shards_for_nodes_test_check_clone
.lock()
.await
shards_for_nodes_test_check
.entry(destination_shard.node_id)
.or_default()
.push(destination_shard.shard_id_on_node);
Expand Down

0 comments on commit cfdeff6

Please sign in to comment.