Skip to content

Commit 7db9bc4

Browse files
committed
test: revert "remove churn() task from lifo_stealable" (#8114)
This reverts commit 6c03e03.
1 parent 9271e3e commit 7db9bc4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tokio/tests/rt_threaded.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,18 @@ fn lifo_stealable() {
730730
.unwrap();
731731

732732
rt.block_on(async {
733+
// Keep the runtime busy so that the workers that might steal the
734+
// blocked task don't all park themselves forever.
735+
//
736+
// Since this task will always be woken by whichever worker is holding
737+
// the time driver, rather than a worker that's executing tasks, it
738+
// shouldn't ever kick the victim task out of its worker's LIFO slot.
739+
let churn = tokio::spawn(async move {
740+
loop {
741+
tokio::time::sleep(Duration::from_millis(4)).await;
742+
}
743+
});
744+
733745
let victim_task_joined = tokio::spawn(async move {
734746
println!("[victim] task started");
735747
task_started_tx.send(()).unwrap();
@@ -779,6 +791,7 @@ fn lifo_stealable() {
779791
// Before possibly panicking, make sure that we wake up the blocker task
780792
// so that it doesn't stop the runtime from shutting down.
781793
block_thread_tx.send(()).unwrap();
794+
churn.abort();
782795
result
783796
.expect("task in LIFO slot should complete within 30 seconds")
784797
.expect("task in LIFO slot should not panic");

0 commit comments

Comments
 (0)