@@ -1287,11 +1287,11 @@ describe("SSH launch during desktop update", () => {
12871287 } ) ,
12881288 ) ;
12891289
1290- it . effect . each ( [ - 30_000 , 120_000 ] ) ( "bounds a host clock jump to %s " , ( clockJump ) =>
1290+ it . effect ( "bounds the wait when the host clock jumps back " , ( ) =>
12911291 Effect . gen ( function * ( ) {
12921292 const result = runLauncher ( yield * captureLauncher , {
12931293 marker : { startedAt : 0 , expiresAt : 60_000 } ,
1294- clockJump,
1294+ clockJump : - 30_000 ,
12951295 } ) ;
12961296 assert . deepEqual ( result . output , { remotePort : 5999 , serverKind : "managed" } ) ;
12971297 assert . isBelow ( result . events . filter ( ( event ) => event . startsWith ( "runtime " ) ) . length , 62 ) ;
@@ -1313,22 +1313,16 @@ describe("SSH launch during desktop update", () => {
13131313 } ) ,
13141314 ) ;
13151315
1316- it . effect . each ( [ false , true ] ) (
1317- "reuses a runtime published before the first marker read (archive: %s)" ,
1318- ( archive ) =>
1319- Effect . gen ( function * ( ) {
1320- const script = archive
1321- ? yield * captureLauncherFor ( { archiveVersion : "1.2.3" } )
1322- : yield * captureLauncher ;
1323- const result = runLauncher ( script , {
1324- archive,
1325- marker : { startedAt : 0 , expiresAt : 60_000 } ,
1326- publishAfterFirstRuntimeRead : true ,
1327- } ) ;
1328- assert . deepEqual ( result . output , { remotePort : 4888 , serverKind : "external" } ) ;
1329- assert . equal ( result . now , 0 ) ;
1330- assert . isFalse ( result . events . some ( ( event ) => event . startsWith ( "start " ) ) ) ;
1331- } ) ,
1316+ it . effect ( "reuses a runtime published before the first marker read" , ( ) =>
1317+ Effect . gen ( function * ( ) {
1318+ const result = runLauncher ( yield * captureLauncher , {
1319+ marker : { startedAt : 0 , expiresAt : 60_000 } ,
1320+ publishAfterFirstRuntimeRead : true ,
1321+ } ) ;
1322+ assert . deepEqual ( result . output , { remotePort : 4888 , serverKind : "external" } ) ;
1323+ assert . equal ( result . now , 0 ) ;
1324+ assert . isFalse ( result . events . some ( ( event ) => event . startsWith ( "start " ) ) ) ;
1325+ } ) ,
13321326 ) ;
13331327
13341328 it . effect ( "waits across the eight-second installer gap and reuses the replacement server" , ( ) =>
@@ -1344,15 +1338,15 @@ describe("SSH launch during desktop update", () => {
13441338 } ) ,
13451339 ) ;
13461340
1347- it . effect ( "waits the full marker lifetime despite immediately failing stale-port probes " , ( ) =>
1341+ it . effect ( "keeps waiting while a stale runtime record points at a dead port " , ( ) =>
13481342 Effect . gen ( function * ( ) {
13491343 const result = runLauncher ( yield * captureLauncher , {
13501344 marker : { startedAt : 0 , expiresAt : 60_000 } ,
13511345 initialPort : 3773 ,
1352- readyAt : 30_000 ,
1346+ readyAt : 3_000 ,
13531347 } ) ;
13541348 assert . deepEqual ( result . output , { remotePort : 4888 , serverKind : "external" } ) ;
1355- assert . equal ( result . now , 30_000 ) ;
1349+ assert . equal ( result . now , 3_000 ) ;
13561350 assert . isFalse ( result . events . some ( ( event ) => event . startsWith ( "start " ) ) ) ;
13571351 } ) ,
13581352 ) ;
0 commit comments