@@ -53,11 +53,20 @@ try {
5353 await symlink ( "missing.php" , join ( danglingSource , "build.sh" ) )
5454 await Promise . all ( Array . from ( { length : 500 } , ( _ , index ) => writeFile ( join ( largeSource , `File${ index } .php` ) , `<?php return ${ index } ;\n` ) ) )
5555 const stagingDirectoriesBefore = await readonlyStagingDirectories ( )
56- await assert . rejects ( stageReadonlyPlaygroundMounts ( [
56+ await using danglingStaging = await stageReadonlyPlaygroundMounts ( [
5757 { source : danglingSource , target : "/dangling" , mode : "readonly" } ,
58+ ] )
59+ const stagedDanglingSource = danglingStaging . mounts [ 0 ] ?. source
60+ assert . ok ( stagedDanglingSource )
61+ await assert . rejects ( access ( join ( stagedDanglingSource , "build.sh" ) ) , / E N O E N T / , "unresolved links must be omitted from isolated readonly staging" )
62+ const stagingDirectoriesWithDangling = await readonlyStagingDirectories ( )
63+ assert . equal ( stagingDirectoriesWithDangling . length , stagingDirectoriesBefore . length + 1 )
64+
65+ await assert . rejects ( stageReadonlyPlaygroundMounts ( [
66+ { source : join ( root , "missing-source" ) , target : "/missing" , mode : "readonly" } ,
5867 { source : largeSource , target : "/large" , mode : "readonly" } ,
5968 ] ) , / E N O E N T / , "the source failure must not be masked by cleanup racing another mount copy" )
60- assert . deepEqual ( await readonlyStagingDirectories ( ) , stagingDirectoriesBefore , "failed concurrent staging must remove its temporary root" )
69+ assert . deepEqual ( await readonlyStagingDirectories ( ) , stagingDirectoriesWithDangling , "failed concurrent staging must remove its temporary root" )
6170
6271 const beforeReadonlyHash = sha256 ( await readFile ( readonlySource ) )
6372 const server = await startPlaygroundCliServer ( spec , [
0 commit comments