Skip to content

Commit d5f71a9

Browse files
committed
make test deterministic
1 parent 10a8a86 commit d5f71a9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scylla/tests/integration/shard_aware_batching.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,17 @@ async fn run_test(
150150
)
151151
});
152152

153+
// Take a global lock to make test deterministic
154+
// (and because we need to push stuff in there to test that shard-awareness is respected)
155+
let mut shards_for_nodes_test_check =
156+
shards_for_nodes_test_check_clone.lock().await;
157+
153158
session
154159
.batch(&scylla_batch, &batch)
155160
.await
156161
.expect("Query to send batch failed");
157162

158-
shards_for_nodes_test_check_clone
159-
.lock()
160-
.await
163+
shards_for_nodes_test_check
161164
.entry(destination_shard.node_id)
162165
.or_default()
163166
.push(destination_shard.shard_id_on_node);

0 commit comments

Comments
 (0)