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: added a test for errors inside promise #4838

Merged
merged 4 commits into from Aug 15, 2019

Conversation

yury-s
Copy link
Contributor

@yury-s yury-s commented Aug 13, 2019

Also bump Chromium revision past 686227 which contained v8 roll with the actual fix.

References #4651

@yury-s
Copy link
Contributor Author

yury-s commented Aug 13, 2019

It seems that the new release will break a bunch of tests, after inspecting CSP changes with Andrey I skipped one of them. There are also crashes in the browser that cause worker tests to timeout:

Failures:

  1. Chromium Browser Page Target should create a worker from a service worker (target.spec.js:86:5)
    Message:
    Timeout Exceeded 10000ms

  2. Chromium Browser Page Target should create a worker from a shared worker (target.spec.js:93:5)
    Message:
    Timeout Exceeded 10000ms

package.json Outdated
@@ -8,7 +8,7 @@
"node": ">=6.4.0"
},
"puppeteer": {
"chromium_revision": "681777"
"chromium_revision": "686378"
Copy link
Collaborator

Choose a reason for hiding this comment

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

we generally do rolls as their own commits, as they can lots of unforeseen side effects.

it('should throw error with detailed information on exception inside promise ', async({page, server}) => {
let error = 'did not catch error';
await page.evaluate(() => new Promise(() => {
does_not_exist.click();
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think this test would be easier to read if you just throw an error here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -255,6 +255,13 @@ module.exports.addTests = function({testRunner, expect}) {
const a = await page.evaluate(() => Array(100 * 1024 * 1024 + 1).join('a'));
expect(a.length).toBe(100 * 1024 * 1024);
});
it('should throw error with detailed information on exception inside promise ', async({page, server}) => {
let error = 'did not catch error';
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: let error = null to be consistent with our other tests that look at errors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find error messages like
'Cannot read property 'message' of null'
less informative than
'expect.toContain failed: did not catch error ⊇ Error in promise'

but I agree that the approach should be consistent across the codebase, so changing it to null, we can update the tests later.

@yury-s
Copy link
Contributor Author

yury-s commented Aug 14, 2019

This is now blocked on #4841

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@aslushnikov aslushnikov merged commit 498492d into puppeteer:master Aug 15, 2019
@yury-s yury-s deleted the issue-4651 branch August 16, 2019 16:36
rfojtik pushed a commit to rfojtik/puppeteer that referenced this pull request Dec 21, 2019
The bug was fixed upstream in V8 and rolled into chromium at r686227.
This adds a test.

Fix puppeteer#4651
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

4 participants