Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX #20226 : Navigation timeout of 30000 ms in click-all-buttons-on-about-foundation-page #20279

Closed
wants to merge 2 commits into from

Conversation

Akhilesh-max
Copy link
Contributor

@Akhilesh-max Akhilesh-max commented May 7, 2024

Overview

  1. This PR fixes or fixes part of [Flake]: Navigation timeout of 30000 ms in click-all-buttons-on-about-foundation-page #20226 .
  2. This PR does the following: It fixes a navigation timeout flake, that was happening because a new navigation was getting triggered before the previous one was resolved.

Essential Checklist

Please follow the instructions for making a code change.

  • I have linked the issue that this PR fixes in the "Development" section of the sidebar.
  • I have checked the "Files Changed" tab and confirmed that the changes are what I want to make.
  • I have written tests for my code.
  • The PR title starts with "Fix #bugnum: " or "Fix part of #bugnum: ...", followed by a short, clear summary of the changes.
  • I have assigned the correct reviewers to this PR (or will leave a comment with the phrase "@{{reviewer_username}} PTAL" if I can't assign them directly).

Proof that changes are correct

Screenshot 2024-05-08 at 2 36 46 AM

PR Pointers

@Akhilesh-max Akhilesh-max requested a review from a team as a code owner May 7, 2024 21:07
Copy link

oppiabot bot commented May 7, 2024

Hi @Akhilesh-max, can you complete the following:

  1. The proof that changes are correct has not been provided, please make sure to upload a image/video showing that the changes are correct. Or include a sentence saying "No proof of changes needed because" and the reason why proof of changes cannot be provided.
    Thanks!

Copy link

oppiabot bot commented May 7, 2024

Hi @Akhilesh-max please assign the required reviewer(s) for this PR. Thanks!

@@ -401,6 +402,9 @@ export class LoggedInUser extends BaseUser {
await this.page.$eval(weCannotContentId, element =>
element.getElementsByTagName('a')[0].click()
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is intermittently failing due to a race condition between two navigations. After clicking the '420 million' link, the test is not waiting for the resulting navigation to complete before the beforeEach block started a new navigation. This lefts the first navigation unresolved, which sometimes leads to failures.
Despite the test logging the final showMessage, it is not properly handling the navigation it initiated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find, @Akhilesh-max!

@@ -401,6 +402,9 @@ export class LoggedInUser extends BaseUser {
await this.page.$eval(weCannotContentId, element =>
element.getElementsByTagName('a')[0].click()
);
await this.page.waitForNavigation({waitUntil: ['load', 'networkidle2']});
await this.page.waitForSelector(_420millionPageHeaderSelector);

if (this.page.url() !== _420MillionUrl) {
throw new Error('The 420 Million link does not open the right page!');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest printing the incorrect URL here in this error message (and in other similar error messages) -- it would help with debugging.

@@ -401,6 +402,9 @@ export class LoggedInUser extends BaseUser {
await this.page.$eval(weCannotContentId, element =>
element.getElementsByTagName('a')[0].click()
);
await this.page.waitForNavigation({waitUntil: ['load', 'networkidle2']});
await this.page.waitForSelector(_420millionPageHeaderSelector);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you actually need this line, or is the previous one alone sufficient?

@@ -401,6 +402,9 @@ export class LoggedInUser extends BaseUser {
await this.page.$eval(weCannotContentId, element =>
element.getElementsByTagName('a')[0].click()
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find, @Akhilesh-max!

Copy link

oppiabot bot commented May 15, 2024

Hi @Akhilesh-max, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 4 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 4 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale label May 15, 2024
@oppiabot oppiabot bot closed this May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants