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

Provide a way to ignore specific global errors #986

Closed
jason0x43 opened this issue Apr 24, 2019 · 8 comments
Closed

Provide a way to ignore specific global errors #986

jason0x43 opened this issue Apr 24, 2019 · 8 comments
Labels
enhancement A new or improved feature

Comments

@jason0x43
Copy link
Member

ResizeObserver can cause global errors that aren't functionally significant. The Browser executor catches unhandled global errors and emits them as error events.

Expected behavior

Benign ResizeObserver errors should not cause a test suite to fail.

Current behavior

Unhandled global errors, such as those emitted by ResizeObserver, are treated as suite-level errors.

✓ chrome 73.0.3683.103 on Windows NT - <test name> (0s)
Suite chrome 73.0.3683.103 on Windows NT FAILED
Error: ResizeObserver loop limit exceeded
  @ node_modules\intern\browser\remote.html?basePath=%2F&runInSync=false&serverUrl=http%3A%2F%2Flocalhost%3A9000%2F&sessionId=0f288438f37cc2d2403e8c9e0c1f0352&socketPort=9001:0:0
TOTAL: tested 1 platforms, 0 passed, 0 failed, 51 not run; suite error occurred

Environment

Intern version: 4.x
Browser version: Chrome 73
OS: Windows

@schontz
Copy link

schontz commented Apr 24, 2019

I tested updating https://github.com/theintern/intern/blob/master/src/lib/executors/Browser.ts#L34 to ignore ResizeObserver errors and the error is gone in serveOnly mode. It still fails as mentioned above in a headless test.

jason0x43 added a commit that referenced this issue May 16, 2019
Provide two new config properties, warnOnUnhandledRejection and
warnOnUncaughtException. When one or both of these are set to true, any
unhandled rejection or exception will be treated as a warning rather
than a failing error. When set to a string or regexp, it will be matched
aagainst any error or rejection reason; matching errors/reasons will be
treated as warnings, others will be failures.

resolves #986
@jason0x43
Copy link
Member Author

@schontz If you get a chance, try out the ignore-global-errors branch. It adds two new config properties, warnOnUnhandledRejection and warnOnUncaughtException (description) that can be used to treat some or all such errors as warnings rather than failures.

@jason0x43 jason0x43 added enhancement A new or improved feature and removed bug Something that's not working as intended labels May 16, 2019
@schontz
Copy link

schontz commented May 16, 2019

Attempted to install it, but npm doesn't like what I'm doing...

C:\dev\_head\cadsrc\client>npm i -D theintern/intern#ignore-global-errors
npm ERR! path C:\dev\_head\cadsrc\client\node_modules\intern\bin\intern.js
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\dev\_head\cadsrc\client\node_modules\intern\bin\intern.js'
npm ERR! enoent This is related to npm not being able to find a file.

@jason0x43
Copy link
Member Author

You'll need to build the package locally. Checkout the ignore-global-errors branch, then run npm run devpack. That will leave you with a tarball (like intern-4.5.0-pre.tgz) that you can install.

@schontz
Copy link

schontz commented May 16, 2019

It works beautifully! I added this to intern.json:

"warnOnUncaughtException": "ResizeObserver loop limit exceeded"

Thank you.


FYI, installing npm run devpack fails on Windows:

intern-4.5.0-pre.tgz
cp: cannot create regular file `../../': Permission denied

But it works using cygwin. Windows is expecting ..\..\. There may be a path.join that needs updating?

@jason0x43
Copy link
Member Author

Glad it works! And thanks for catching the Windows install issue. I try to be cross platform, but it's easy for those kinds of issues to slip through.

@schontz
Copy link

schontz commented May 16, 2019

Sure thing. Most folks won't be developing intern on Windows, but, alas, here we are!

@jason0x43
Copy link
Member Author

Since this is a new feature, it'll go out in 4.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new or improved feature
Projects
None yet
Development

No branches or pull requests

2 participants