@@ -322,50 +322,46 @@ fn live_cache_inspection_uses_registered_allocator_during_inserts() {
322322}
323323
324324const STORAGE_BIN_LEASE_CHILD_ROOT : & str = "FLUXHEIM_STORAGE_BIN_LEASE_CHILD_ROOT" ;
325- const STORAGE_BIN_LEASE_CHILD_MARKER : & str = "FLUXHEIM_STORAGE_BIN_LEASE_CHILD_MARKER" ;
326325const STORAGE_BIN_LEASE_CHILD_MAX_BYTES : & str = "FLUXHEIM_STORAGE_BIN_LEASE_CHILD_MAX_BYTES" ;
326+ const STORAGE_BIN_LEASE_CHILD_CONFIRMED : & str = "fluxheim-storage-bin-lease-child-confirmed" ;
327327
328328#[ test]
329329fn storage_bin_lease_child_process ( ) {
330330 let Some ( root) = std:: env:: var_os ( STORAGE_BIN_LEASE_CHILD_ROOT ) else {
331331 return ;
332332 } ;
333- let marker = std:: env:: var_os ( STORAGE_BIN_LEASE_CHILD_MARKER ) . unwrap ( ) ;
334333 let mut config = storage_bin_config ( std:: path:: Path :: new ( & root) ) ;
335334 if let Ok ( max_bytes) = std:: env:: var ( STORAGE_BIN_LEASE_CHILD_MAX_BYTES ) {
336335 config. disk . max_size_bytes = ByteSize :: from_bytes ( max_bytes. parse ( ) . unwrap ( ) ) ;
337336 }
338337
339338 let error = NativeDiskCacheBackend :: from_config ( & config) . unwrap_err ( ) ;
340339 assert_eq ! ( error. kind( ) , std:: io:: ErrorKind :: AlreadyExists ) ;
341- std :: fs :: write ( marker , b"locked" ) . unwrap ( ) ;
340+ println ! ( "{STORAGE_BIN_LEASE_CHILD_CONFIRMED}" ) ;
342341}
343342
344343#[ test]
345344fn storage_bin_lease_rejects_second_process ( ) {
346345 let directory = tempfile:: tempdir ( ) . unwrap ( ) ;
347346 let root = directory. path ( ) . join ( "cache" ) ;
348- let marker = directory. path ( ) . join ( "child-confirmed" ) ;
349347 let config = storage_bin_config ( & root) ;
350348 let _cache = NativeDiskCache :: from_config ( & config) . unwrap ( ) ;
351- let status = std:: process:: Command :: new ( std:: env:: current_exe ( ) . unwrap ( ) )
349+ let output = std:: process:: Command :: new ( std:: env:: current_exe ( ) . unwrap ( ) )
352350 . arg ( "--exact" )
353351 . arg ( "native_http1_cache::tests::storage_bin_lease_child_process" )
354352 . arg ( "--nocapture" )
355353 . env ( STORAGE_BIN_LEASE_CHILD_ROOT , & root)
356- . env ( STORAGE_BIN_LEASE_CHILD_MARKER , & marker)
357- . status ( )
354+ . output ( )
358355 . unwrap ( ) ;
359356
360- assert ! ( status. success( ) ) ;
361- assert_eq ! ( std :: fs :: read ( marker ) . unwrap ( ) , b"locked" ) ;
357+ assert ! ( output . status. success( ) ) ;
358+ assert ! ( String :: from_utf8_lossy ( & output . stdout ) . contains ( STORAGE_BIN_LEASE_CHILD_CONFIRMED ) ) ;
362359}
363360
364361#[ test]
365362fn storage_bin_loser_cannot_mutate_winner_layout ( ) {
366363 let directory = tempfile:: tempdir ( ) . unwrap ( ) ;
367364 let configured_root = directory. path ( ) . join ( "cache" ) ;
368- let marker = directory. path ( ) . join ( "child-confirmed" ) ;
369365 let winner_config = storage_bin_config ( & configured_root) ;
370366 let root = super :: prepare_native_storage_bin_root_for_lease ( & winner_config) . unwrap ( ) ;
371367 let _lease = acquire_native_storage_bin_lease ( & root) . unwrap ( ) ;
@@ -376,20 +372,19 @@ fn storage_bin_loser_cannot_mutate_winner_layout() {
376372 let manifest_path = root. join ( ".fluxheim-storage-bin-v1" ) ;
377373 let winning_manifest = std:: fs:: read ( & manifest_path) . unwrap ( ) ;
378374
379- let status = std:: process:: Command :: new ( std:: env:: current_exe ( ) . unwrap ( ) )
375+ let output = std:: process:: Command :: new ( std:: env:: current_exe ( ) . unwrap ( ) )
380376 . arg ( "--exact" )
381377 . arg ( "native_http1_cache::tests::storage_bin_lease_child_process" )
382378 . arg ( "--nocapture" )
383379 . env ( STORAGE_BIN_LEASE_CHILD_ROOT , & root)
384- . env ( STORAGE_BIN_LEASE_CHILD_MARKER , & marker)
385380 . env (
386381 STORAGE_BIN_LEASE_CHILD_MAX_BYTES ,
387382 ( 2 * 1024 * 1024 ) . to_string ( ) ,
388383 )
389- . status ( )
384+ . output ( )
390385 . unwrap ( ) ;
391386
392- assert ! ( status. success( ) ) ;
393- assert_eq ! ( std :: fs :: read ( marker ) . unwrap ( ) , b"locked" ) ;
387+ assert ! ( output . status. success( ) ) ;
388+ assert ! ( String :: from_utf8_lossy ( & output . stdout ) . contains ( STORAGE_BIN_LEASE_CHILD_CONFIRMED ) ) ;
394389 assert_eq ! ( std:: fs:: read( manifest_path) . unwrap( ) , winning_manifest) ;
395390}
0 commit comments