@@ -310,21 +310,31 @@ describe("device setup consent", () => {
310310 } ) . pipe ( Effect . scoped ) ,
311311 ) ;
312312
313- it . effect ( "boots a stopped Android AVD and uses its emulator serial without duplicating it" , ( ) =>
314- Effect . gen ( function * ( ) {
315- const { service, requests } = yield * fixture ( ) ;
316- yield * service . configure ( { enabled : true } ) ;
317- const session = yield * service . open ( {
318- threadId : ThreadId . make ( "thread-1" ) ,
319- deviceId : "Pixel_API_35" ,
320- platform : "android" ,
321- } ) ;
322- expect ( session . deviceId ) . toBe ( "emulator-5554" ) ;
323- expect ( requests . filter ( ( url ) => url . endsWith ( "/boot" ) ) ) . toHaveLength ( 1 ) ;
324- const state = yield * service . state ;
325- expect ( state . devices . map ( ( device ) => device . id ) ) . toEqual ( [ "emulator-5554" ] ) ;
326- expect ( state . bootingDevices ) . toEqual ( [ ] ) ;
327- } ) . pipe ( Effect . scoped ) ,
313+ it . effect . each ( [ 1 , 2 ] ) (
314+ "opens a stopped Android AVD from %s threads using its emulator serial" ,
315+ ( count ) =>
316+ Effect . gen ( function * ( ) {
317+ const { service, requests } = yield * fixture ( ) ;
318+ yield * service . configure ( { enabled : true } ) ;
319+ const sessions = yield * Effect . all (
320+ Array . from ( { length : count } , ( _ , index ) =>
321+ service . open ( {
322+ threadId : ThreadId . make ( `thread-${ index } ` ) ,
323+ deviceId : "Pixel_API_35" ,
324+ platform : "android" ,
325+ } ) ,
326+ ) ,
327+ { concurrency : "unbounded" } ,
328+ ) ;
329+ expect ( sessions . map ( ( session ) => session . deviceId ) ) . toEqual (
330+ Array ( count ) . fill ( "emulator-5554" ) ,
331+ ) ;
332+ expect ( requests . filter ( ( url ) => url . endsWith ( "/boot" ) ) ) . toHaveLength ( count ) ;
333+ const state = yield * service . state ;
334+ expect ( state . sessions ) . toHaveLength ( count ) ;
335+ expect ( state . devices . map ( ( device ) => device . id ) ) . toEqual ( [ "emulator-5554" ] ) ;
336+ expect ( state . bootingDevices ) . toEqual ( [ ] ) ;
337+ } ) . pipe ( Effect . scoped ) ,
328338 ) ;
329339
330340 it . effect ( "blocks only emulator video until ffmpeg is usable, then allows retry" , ( ) =>
0 commit comments