Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion native/local/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ mod tests {
let result = receiver.recv_timeout(Duration::from_secs(5)).unwrap();
assert!(result.err().unwrap().to_string().contains("cancelled"));
assert!(started.elapsed() < Duration::from_secs(5));
assert_eq!(refs.strong_count(), 0);
let releasing = Instant::now();
while refs.strong_count() != 0 {
assert!(
releasing.elapsed() < Duration::from_secs(5),
"cancelled graph remained live"
);
std::thread::yield_now();
}
thread.join().unwrap();
}
}
3 changes: 1 addition & 2 deletions native/local/tests/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ async fn partition_order_cancel_releases_running_partitions() {
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn partition_order_runs_at_most_the_given_number_of_partitions() {
let (plan, observations) = observe(ordered_input(6, 3));
let executed = || observations.executions.lock().unwrap().clone();
let mut stream = LocalQuery::new(plan, context(), 2, usize::MAX)
.execute()
.unwrap();
Expand All @@ -490,7 +489,7 @@ async fn partition_order_runs_at_most_the_given_number_of_partitions() {
.unwrap()
.unwrap();
}
assert_eq!(executed(), vec![0, 1]);
assert_executed_once(&observations, 2);
// Finishing the first partition starts the third.
timeout(DEADLINE, stream.next())
.await
Expand Down