@@ -212,7 +212,7 @@ test("evicts an unresponsive registered service before starting its replacement"
212212 const replacement = await Bun . file ( registration ) . json ( )
213213 fixture . track ( replacement . pid )
214214
215- expect ( ( await Bun . file ( registration + ".requests" ) . text ( ) ) . trim ( ) . split ( "\n" ) ) . toHaveLength ( 3 )
215+ expect ( ( await Bun . file ( registration + ".requests" ) . text ( ) ) . trim ( ) . split ( "\n" ) ) . toHaveLength ( 5 )
216216 expect ( await existing . exited ) . toBe ( 0 )
217217 expect ( replacement . pid ) . not . toBe ( original . pid )
218218 expect ( endpoint . url ) . toBe ( replacement . url )
@@ -272,6 +272,27 @@ test("stops the registered service even when terminal handoff fails", async () =
272272 expect ( ( await Bun . file ( registration + ".pty-handoff" ) . json ( ) ) . handoff ) . toBeNull ( )
273273} )
274274
275+ test ( "keeps a registered service that recovers after transient probe stalls" , async ( ) => {
276+ await using fixture = await serviceFixture ( )
277+ const registration = fixture . registration
278+ const existing = fixture . spawn ( "flaky" , "3" )
279+ await fixture . waitForFile ( )
280+ const original = await Bun . file ( registration ) . json ( )
281+
282+ const endpoint = await ensure ( {
283+ file : registration ,
284+ version : "test" ,
285+ command : fixture . command ( "delayed" , "10" ) ,
286+ } )
287+ const current = await Bun . file ( registration ) . json ( )
288+ fixture . track ( current . pid )
289+
290+ expect ( ( await Bun . file ( registration + ".requests" ) . text ( ) ) . trim ( ) . split ( "\n" ) ) . toHaveLength ( 4 )
291+ expect ( existing . exitCode ) . toBe ( null )
292+ expect ( current . pid ) . toBe ( original . pid )
293+ expect ( endpoint . url ) . toBe ( original . url )
294+ } )
295+
275296test ( "signals the registered service process" , async ( ) => {
276297 await using fixture = await serviceFixture ( )
277298 const registration = fixture . registration
0 commit comments