E2E: reload the page after the log in process completes, but before the test steps take over. #77360
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #70674.
Proposed Changes
This PR adds a reload step after the log in process, but before the test steps take over, ostensibly to reset the state before the tests begin as a workaround to the page crash. This workaround was suggested in microsoft/playwright#18137.
The original issue describes a situation where the teardown code makes an attempt to screenshot the page, but is unable to do so because the page has already crashed. After some investigations, we find that a comment on microsoft/playwright closely (but not exactly) describes our issue.
During the login process for browsers controlled by Playwright:
This all occurs with milliseconds to spare because Playwright is able to act on pages several orders of magnitude faster than humans can. The hypothesis is that this is what's causing the eventual page crash.
The proposed idea is to insert a state-resetting
reload
call between the third and fourth steps to "reset" the state. This way, the test steps are not attempt to execute code on a log in process that has not yet fully completed.Testing Instructions
Ensure the following build configurations are passing:
I've also ran the proposed changes under a "stress test" of 100 iterations or 20 minutes of execution time, whichever comes first. The idea is to run most of the E2E specs in a single build, repeatedly, in the hopes that a problem either arises (in which case the fix has not worked) or does not arise (in which case the fix has high confidence of working).
For this PR, I ran multiple iterations, first with a limited set of specs and then gradually adding more.
First iteration - 15 test steps.
Second iteration - 15 test steps.
Third iteration - 48 test steps.
Fourth iteration - 89 test steps.
So far, through all iterations the crashing issue has not once cropped up.
Pre-merge Checklist