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

tests(devtools): ensure WebSQL table is populated #13579

Merged
merged 1 commit into from
Jan 19, 2022
Merged

Conversation

adamraine
Copy link
Member

Should prevent the flakiness in DevTools tests.

@adamraine adamraine requested a review from a team as a code owner January 19, 2022 00:17
@adamraine adamraine requested review from connorjclark and removed request for a team January 19, 2022 00:17
await TestRunner.RuntimeAgent.invoke_evaluate({
expression: 'webSqlPromise',
awaitPromise: true,
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried fixing this too. I did this:

image

I was trying to make LH wait for the DB by waiting for first paint.

But... this went from flaky to never seeing the DB usage. I never figured out why.

Copy link
Collaborator

@connorjclark connorjclark Jan 19, 2022

Choose a reason for hiding this comment

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

ooooh, I see what you've done. You made the DB get initiated before LH even runs. To make that more clear can you move this to right after the navigate?

So how was this ever working before? :)

Copy link
Member Author

@adamraine adamraine Jan 19, 2022

Choose a reason for hiding this comment

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

So how was this ever working before?

It was flaky, sometimes the row would be added to the table in time, and sometimes it wouldn't. In CI it usually got added in time so I just kinda ignored the problem when it showed up locally.

Toplevel await works in module scripts, but the script itself is loaded asynchronously so there still isn't a guarantee that the row is added to the table before the page loads. I'm not sure if toplevel await is supported like you have it.

Copy link
Member Author

Choose a reason for hiding this comment

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

To make that more clear can you move this to right after the navigate?

Move what to the right? Sorry don't understand.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not "to the right". "right after" TestRunner.navigatePromise.

Copy link
Member Author

Choose a reason for hiding this comment

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

🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃 🙃

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

Successfully merging this pull request may close these issues.

3 participants