Skip to content

Commit 25ae1c5

Browse files
random
1 parent 248a7b7 commit 25ae1c5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/common/ttl_map.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ mod tests {
368368

369369
let start_time = Instant::now();
370370
let task_count = 100_000;
371-
let contention_factor = 10;
372371

373372
// Spawn 10 tasks that repeatedly read the same keys
374373
let mut handles = Vec::new();
@@ -377,7 +376,7 @@ mod tests {
377376
let handle = tokio::spawn(async move {
378377
// All tasks fight for the same keys - maximum contention
379378
let start = Instant::now();
380-
let _value = map.get_or_init(task_id % (task_count / contention_factor), || task_id * 1000).await;
379+
let _value = map.get_or_init(rand::random(), || task_id * 1000).await;
381380
start.elapsed().as_nanos()
382381
});
383382
handles.push(handle);

0 commit comments

Comments
 (0)