File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,8 +57,14 @@ export const test = base.extend<TestArgs, WorkerArgs>({
5757 async ( { getProjectMetadata } , use ) => {
5858 return use ( async ( ) => {
5959 const authStorageFile = getProjectMetadata ( 'authStorageFile' ) ;
60+ // Wait for auth file to exist with timeout
61+ let attempts = 0 ;
62+ while ( ! fs . existsSync ( authStorageFile ) && attempts < 50 ) {
63+ await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
64+ attempts ++ ;
65+ }
6066 if ( ! fs . existsSync ( authStorageFile ) ) {
61- throw new Error ( `Cannot get project auth: storage file does not exist: ${ authStorageFile } ` ) ;
67+ throw new Error ( `Cannot get project auth: storage file does not exist after waiting : ${ authStorageFile } ` ) ;
6268 }
6369 return JSON . parse ( await fs . promises . readFile ( authStorageFile , 'utf8' ) ) as ProjectAuth ;
6470 } ) ;
You can’t perform that action at this time.
0 commit comments