-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Conversation
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:
|
package.json
Outdated
@@ -8,7 +8,7 @@ | |||
"node": ">=6.4.0" | |||
}, | |||
"puppeteer": { | |||
"chromium_revision": "681777" | |||
"chromium_revision": "686378" |
There was a problem hiding this comment.
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.
test/evaluation.spec.js
Outdated
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
test/evaluation.spec.js
Outdated
@@ -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'; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
This is now blocked on #4841 |
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 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 ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
The bug was fixed upstream in V8 and rolled into chromium at r686227. This adds a test. Fix puppeteer#4651
Also bump Chromium revision past 686227 which contained v8 roll with the actual fix.
References #4651