From 87fdc13d4f22f897c112e18c89db039acde03280 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 23 Dec 2024 17:08:26 +0100 Subject: [PATCH] Fix parallel_map::execute_cancellation test --- tests/parallel/parallel_map.rs | 5 +++-- tests/parallel/signal.rs | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/parallel/parallel_map.rs b/tests/parallel/parallel_map.rs index 80e4ebea..dee46fd8 100644 --- a/tests/parallel/parallel_map.rs +++ b/tests/parallel/parallel_map.rs @@ -15,17 +15,18 @@ struct ParallelInput { fn tracked_fn(db: &dyn salsa::Database, input: ParallelInput) -> Vec { salsa::par_map(db, input.field(db), |_db, field| field + 1) } + #[salsa::tracked] fn a1(db: &dyn KnobsDatabase, input: ParallelInput) -> Vec { db.signal(1); salsa::par_map(db, input.field(db), |db, field| { db.wait_for(2); - field + 1 + field + dummy(db) }) } #[salsa::tracked] -fn dummy(_db: &dyn KnobsDatabase, _input: ParallelInput) -> ParallelInput { +fn dummy(_db: &dyn KnobsDatabase) -> u32 { panic!("should never get here!") } diff --git a/tests/parallel/signal.rs b/tests/parallel/signal.rs index f09aecc8..e93cb469 100644 --- a/tests/parallel/signal.rs +++ b/tests/parallel/signal.rs @@ -8,8 +8,6 @@ pub(crate) struct Signal { impl Signal { pub(crate) fn signal(&self, stage: usize) { - dbg!(format!("signal({})", stage)); - // This check avoids acquiring the lock for things that will // clearly be a no-op. Not *necessary* but helps to ensure we // are more likely to encounter weird race conditions; @@ -27,8 +25,6 @@ impl Signal { /// Waits until the given condition is true; the fn is invoked /// with the current stage. pub(crate) fn wait_for(&self, stage: usize) { - dbg!(format!("wait_for({})", stage)); - // As above, avoid lock if clearly a no-op. if stage > 0 { let mut v = self.value.lock();