File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -679,10 +679,21 @@ describe("API", () => {
679679 expect ( pageErrors ) . toMatchSnapshot ( "page errors" ) ;
680680 } catch ( error ) {
681681 if ( error . code === "EACCES" ) {
682- console . warn (
683- `Skipping test due to permission issues: ${ error . message } ` ,
684- ) ;
685- return ;
682+ // Retry mechanism for EACCES errors
683+ const maxRetries = 3 ;
684+ const retryKey = `retry_${ expect . getState ( ) . currentTestName } ` ;
685+
686+ // Get current retry count or initialize to 0
687+ global [ retryKey ] = global [ retryKey ] || 0 ;
688+ global [ retryKey ] += 1 ;
689+
690+ if ( global [ retryKey ] < maxRetries ) {
691+ console . warn (
692+ `EACCES error encountered (attempt ${ global [ retryKey ] } /${ maxRetries } ): ${ error . message } . Retrying...` ,
693+ ) ;
694+ // Re-run the current test
695+ return it . currentTest . fn ( ) ;
696+ }
686697 }
687698 throw error ;
688699 } finally {
You can’t perform that action at this time.
0 commit comments