Add retries in e2e tests for Paratext login#3854
Conversation
e7b5149 to
302caca
Compare
Nateowami
left a comment
There was a problem hiding this comment.
@Nateowami made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion.
src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts line 469 at r1 (raw file):
throw new Error(`Failed to log in after ${tries} attempts`); } console.log(`Logged in as ${user.email} after ${tries} ${tries === 1 ? 'try' : 'tries'}`);
While logging is kept to a minimum in e2e tests, this is currently our biggest source of failures, so I think having visibility into whether this retry is helping is valuable.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3854 +/- ##
=======================================
Coverage 81.03% 81.03%
=======================================
Files 630 630
Lines 40586 40586
Branches 6584 6584
=======================================
Hits 32889 32889
Misses 6662 6662
Partials 1035 1035 ☔ View full report in Codecov by Sentry. |
302caca to
7981387
Compare
7981387 to
440af55
Compare
440af55 to
f0760ee
Compare
marksvc
left a comment
There was a problem hiding this comment.
Good job. I think there is a bug in the for loop.
@marksvc reviewed 1 file and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on Nateowami).
src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts line 469 at r1 (raw file):
Previously, Nateowami wrote…
While logging is kept to a minimum in e2e tests, this is currently our biggest source of failures, so I think having visibility into whether this retry is helping is valuable.
👍
src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts line 412 at r2 (raw file):
let attempt = 0; let loginSuccessful = false; for (attempt++; !loginSuccessful && attempt <= 5; ) {
Shouldn't this read something like the following?
for (attempt=1; !loginSuccessful && attempt <= 5; attempt++) {(Or:
let attempt = 1;
let loginSuccessful = false;
for (; !loginSuccessful && attempt <= 5; attempt++) {)
This attempts to address one of our most common failures, which is unsuccessfully logging in because the Paratext Registry wants us to use the Google login method, even though we have a email/password account.
This change is