time: fix the loom test of the race between cancellation/insertion (#8302)

This commit is contained in:
ADD-SP
2026-07-20 19:10:31 +08:00
committed by GitHub
parent 91d3b4c0bc
commit eb4988dc2e
2 changed files with 31 additions and 27 deletions
+2
View File
@@ -15,6 +15,8 @@ R-loom-time-driver:
- any-glob-to-any-file: - any-glob-to-any-file:
- tokio/src/runtime/time/* - tokio/src/runtime/time/*
- tokio/src/runtime/time/**/* - tokio/src/runtime/time/**/*
- tokio/src/runtime/time_alt/*
- tokio/src/runtime/time_alt/**/*
R-loom-current-thread: R-loom-current-thread:
- changed-files: - changed-files:
+2
View File
@@ -97,6 +97,7 @@ fn cancel_in_the_same_thread() {
#[test] #[test]
fn insert_of_already_cancelled_entry_does_not_enter_wheel() { fn insert_of_already_cancelled_entry_does_not_enter_wheel() {
model(|| {
let (cancel_tx, mut cancel_rx) = cancellation_queue::new(); let (cancel_tx, mut cancel_rx) = cancellation_queue::new();
let mut wheel = Wheel::new(); let mut wheel = Wheel::new();
@@ -130,6 +131,7 @@ fn insert_of_already_cancelled_entry_does_not_enter_wheel() {
let mut wake_queue = WakeQueue::new(); let mut wake_queue = WakeQueue::new();
wheel.take_expired(u64::MAX, &mut wake_queue); wheel.take_expired(u64::MAX, &mut wake_queue);
wake_queue.wake_all(); wake_queue.wake_all();
});
} }
#[test] #[test]