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

test(nextjs): Attempt to make Next.js integration tests less flakey #6130

Merged
merged 1 commit into from Nov 4, 2022

Conversation

lforst
Copy link
Member

@lforst lforst commented Nov 3, 2022

Partly adresses #6053

I guess there is a possibility that requests go out in between the page.goto() calls and the page.waitForRequest(), causing us to wait for the latter indefinitely.
If we await the request before we go to the page, there is no way a request is sent before page.waitForRequest() is called.

@lforst lforst marked this pull request as ready for review November 3, 2022 15:25
await page.goto(`${url}/healthy`);
await page.waitForRequest(isTransactionRequest);
await requestPromise;
Copy link
Member

Choose a reason for hiding this comment

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

l: Might be nice to make this a util

@lobsterkatie
Copy link
Member

Could you include a sentence or two in the PR description explaining the logic here, please?

@lforst
Copy link
Member Author

lforst commented Nov 4, 2022

Ok so we didn't eliminate flakes completely with this but at least there were no timeouts anymore in 5 reruns so let's just roll with it.

@lforst lforst merged commit f2516fd into master Nov 4, 2022
@lforst lforst deleted the lforst-deflake-nextjs-tests branch November 4, 2022 08:46
@lobsterkatie
Copy link
Member

Could you include a sentence or two in the PR description explaining the logic here, please?

I guess there is a possibility that requests go out in between the page.goto() calls and the page.waitForRequest(), causing us to wait for the latter indefinitely.
If we await the request before we go to the page, there is no way a request is sent before page.waitForRequest() is called.

Ah, right, okay, this makes sense. Unawaited waitForRequest() is really just startWaitingForRequest(). Because promises.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants