Skip to content

Commit e5da645

Browse files
committed
fix
Signed-off-by: Joe Isaacs <[email protected]>
1 parent c5dfb5e commit e5da645

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vortex-io/src/runtime/tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,18 +326,20 @@ async fn test_task_detach() {
326326
let handle = TokioRuntime::current();
327327
let counter = Arc::new(AtomicUsize::new(0));
328328
let c = counter.clone();
329+
let (tx, rx) = oneshot::channel::<()>();
329330

330331
let task = handle.spawn(async move {
331332
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
332333
c.fetch_add(1, Ordering::SeqCst);
333-
42
334+
tx.send(())
334335
});
335336

336337
// Detach the task so it continues running
337338
task.detach();
338339

339340
// Wait for task to complete
340341
tokio::time::sleep(std::time::Duration::from_millis(20)).await;
342+
let _ = rx.await;
341343

342344
// Task should have completed even though we detached it
343345
assert_eq!(counter.load(Ordering::SeqCst), 1);

0 commit comments

Comments
 (0)