Browse Source

test(core): Attempt to fix flaky e2e test in postgres

Michael Bromley 2 years ago
parent
commit
bf39147304
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/core/e2e/shop-auth.e2e-spec.ts

+ 3 - 1
packages/core/e2e/shop-auth.e2e-spec.ts

@@ -1251,7 +1251,9 @@ describe('Updating email address without email verification', () => {
             newEmailAddress: NEW_EMAIL_ADDRESS,
         });
         successErrorGuard.assertSuccess(requestUpdateCustomerEmailAddress);
-
+        // Attempting to fix flakiness possibly caused by race condition on the event
+        // subscriber
+        await new Promise(resolve => setTimeout(resolve, 100));
         expect(requestUpdateCustomerEmailAddress.success).toBe(true);
         expect(sendEmailFn).toHaveBeenCalledTimes(1);
         expect(sendEmailFn.mock.calls[0][0] instanceof IdentifierChangeEvent).toBe(true);