@@ -275,10 +275,15 @@ mod tests {
275275 use vortex_array:: expr:: not;
276276 use vortex_array:: expr:: pack;
277277 use vortex_array:: expr:: root;
278+ use vortex_array:: scalar_fn:: session:: ScalarFnSession ;
279+ use vortex_array:: session:: ArraySession ;
278280 use vortex_array:: validity:: Validity ;
279281 use vortex_error:: VortexExpect ;
282+ use vortex_io:: runtime:: Handle ;
280283 use vortex_io:: runtime:: single:: block_on;
284+ use vortex_io:: session:: RuntimeSession ;
281285 use vortex_io:: session:: RuntimeSessionExt ;
286+ use vortex_session:: VortexSession ;
282287
283288 use crate :: LayoutId ;
284289 use crate :: LayoutRef ;
@@ -291,12 +296,23 @@ mod tests {
291296 use crate :: sequence:: SequentialArrayStreamExt ;
292297 use crate :: sequence:: SequentialStreamAdapter ;
293298 use crate :: sequence:: SequentialStreamExt ;
294- use crate :: test:: SESSION ;
299+ use crate :: session:: LayoutSession ;
300+
301+ // FIXME(ngates): Deprecate the global `runtime::single::block_on` helper and require tests
302+ // to call `block_on` on an explicit runtime instance.
303+ fn session_with_handle ( handle : Handle ) -> VortexSession {
304+ VortexSession :: empty ( )
305+ . with :: < ArraySession > ( )
306+ . with :: < LayoutSession > ( )
307+ . with :: < ScalarFnSession > ( )
308+ . with :: < RuntimeSession > ( )
309+ . with_handle ( handle)
310+ }
295311
296312 #[ test]
297313 fn reading_nested_packs_works ( ) {
298314 block_on ( |handle| async move {
299- let session = SESSION . clone ( ) . with_handle ( handle) ;
315+ let session = session_with_handle ( handle) ;
300316 let strategy = DictStrategy :: new (
301317 FlatLayoutStrategy :: default ( ) ,
302318 FlatLayoutStrategy :: default ( ) ,
@@ -347,7 +363,7 @@ mod tests {
347363 ) ;
348364 assert ! ( layout. encoding_id( ) == LayoutId :: new_ref( "vortex.dict" ) ) ;
349365 let actual = layout
350- . new_reader ( "" . into ( ) , segments, & SESSION )
366+ . new_reader ( "" . into ( ) , segments, & session )
351367 . unwrap ( )
352368 . projection_evaluation (
353369 & ( 0 ..layout. row_count ( ) ) ,
@@ -395,7 +411,7 @@ mod tests {
395411 #[ case] expected : Vec < bool > ,
396412 ) {
397413 block_on ( |handle| async move {
398- let session = SESSION . clone ( ) . with_handle ( handle) ;
414+ let session = session_with_handle ( handle) ;
399415 let strategy = DictStrategy :: new (
400416 FlatLayoutStrategy :: default ( ) ,
401417 FlatLayoutStrategy :: default ( ) ,
@@ -431,7 +447,7 @@ mod tests {
431447 ) ) ,
432448 ) ;
433449 let mask = layout
434- . new_reader ( "" . into ( ) , segments, & SESSION )
450+ . new_reader ( "" . into ( ) , segments, & session )
435451 . unwrap ( )
436452 . filter_evaluation ( & ( 0 ..3 ) , & filter, MaskFuture :: new_true ( 3 ) )
437453 . unwrap ( )
@@ -445,7 +461,7 @@ mod tests {
445461 #[ test]
446462 fn reading_is_null_works ( ) {
447463 block_on ( |handle| async move {
448- let session = SESSION . clone ( ) . with_handle ( handle) ;
464+ let session = session_with_handle ( handle) ;
449465 let strategy = DictStrategy :: new (
450466 FlatLayoutStrategy :: default ( ) ,
451467 FlatLayoutStrategy :: default ( ) ,
@@ -491,7 +507,7 @@ mod tests {
491507 let expression = not ( is_null ( root ( ) ) ) ; // easier to test not_is_null b/c that's the validity array
492508 assert_eq ! ( layout. encoding_id( ) , LayoutId :: new_ref( "vortex.dict" ) ) ;
493509 let actual = layout
494- . new_reader ( "" . into ( ) , segments, & SESSION )
510+ . new_reader ( "" . into ( ) , segments, & session )
495511 . unwrap ( )
496512 . projection_evaluation (
497513 & ( 0 ..layout. row_count ( ) ) ,
0 commit comments