Skip to content

Commit e769588

Browse files
committed
vortex-file: Spawn tasks via runtime instead of directly via tokio
1 parent a649d75 commit e769588

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

vortex-file/src/segments/source.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,13 @@ mod tests {
468468
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
469469
async fn file_segment_source_panic_propagates_to_all_concurrent_readers() {
470470
let source = Arc::new(panicking_source());
471+
let handle = TokioRuntime::current();
471472
let reader_count = 8;
472473

473474
let readers: Vec<_> = (0..reader_count)
474475
.map(|_| {
475476
let source = Arc::clone(&source);
476-
tokio::spawn(async move {
477+
handle.spawn(async move {
477478
AssertUnwindSafe(source.request(SegmentId::from(0)))
478479
.catch_unwind()
479480
.await
@@ -488,7 +489,7 @@ mod tests {
488489

489490
let mut original_panics = 0;
490491
for reader in joined {
491-
match reader.expect("reader task panicked at the join boundary") {
492+
match reader {
492493
// The first reader to observe completion re-raises the original panic.
493494
Err(payload) => {
494495
assert!(
@@ -557,10 +558,11 @@ mod tests {
557558
RequestMetrics::new(&metrics, vec![]),
558559
));
559560

561+
let handle = TokioRuntime::current();
560562
let tasks: Vec<_> = (0..n)
561563
.map(|i| {
562564
let source = Arc::clone(&source);
563-
tokio::spawn(async move { source.request(SegmentId::from(i)).await })
565+
handle.spawn(async move { source.request(SegmentId::from(i)).await })
564566
})
565567
.collect();
566568

0 commit comments

Comments
 (0)