Merge pull request #31415 from woocommerce/fix/jest-e2e-retries

Fix jest e2e retries
This commit is contained in:
Ron Rennick 2021-12-14 22:34:22 -04:00 committed by GitHub
commit b478bbb949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -3,10 +3,12 @@
*/
const { E2E_RETRY_TIMES } = process.env;
const setupJestRetries = ( retries = 2 ) => {
const setupJestRetries = ( retries = 0 ) => {
const retryTimes = E2E_RETRY_TIMES ? E2E_RETRY_TIMES : retries;
jest.retryTimes( retryTimes );
if ( retryTimes > 0 ) {
jest.retryTimes( retryTimes );
}
};
// If more methods are added to setupJestObject, it should be include in the readme

View File

@ -40,7 +40,7 @@ async function trashExistingPosts() {
// each other's side-effects.
beforeAll(async () => {
setupJestRetries();
setupJestRetries( 2 );
if ( DEFAULT_TIMEOUT_OVERRIDE ) {
page.setDefaultNavigationTimeout( DEFAULT_TIMEOUT_OVERRIDE );