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

Weird test failures related to puppeteer #3694

Closed
peterbe opened this issue May 4, 2021 · 1 comment · Fixed by #3696
Closed

Weird test failures related to puppeteer #3694

peterbe opened this issue May 4, 2021 · 1 comment · Fixed by #3696

Comments

@peterbe
Copy link
Contributor

peterbe commented May 4, 2021

I started seeing these recently.
It seems it's flaky, on main and the traceback doesn't refer back to anything in our code.

First I run the contents of testing/scripts/functional-test.sh like this:

export ENV_FILE=testing/.env

# Temporary whilst only the functional tests use the autocomplete search widget.
export REACT_APP_AUTOCOMPLETE_SEARCH_WIDGET=true

yarn prepare-build
yarn build

yarn test:testing

Sometimes it works. Sometimes it fails. I can run yarn test:testing index which means jest should avoid anything related to puppeteer but it clearly doesn't :(

Here's what an error might look like:

 RUNS  tests/redirects.test.js
 RUNS  tests/headless.test.js
 RUNS  tests/developing.test.js
 RUNS  tests/destructive.test.js
 RUNS  tests/sitesearch.test.js
 RUNS  tests/search.test.js
 RUNS  tests/filecheck.test.js
 RUNS  tests/index.test.js

Test Suites: 0 of 8 total
Tests:       0 total
Snapshots:   0 total
Time:        0 s, estimated 4 s
████████████████████████████████████████/Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:26
        throw new Error(message);
              ^

Error: target should exist before targetInfoChanged
    at Object.assert (/Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:26:15)
    at Browser._targetInfoChanged (/Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:205:21)
    at /Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:62
    at Array.map (<anonymous>)
    at Object.emit (/Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:43)
    at Connection.emit (/Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/puppeteer/lib/cjs/puppeteer/common/EventEmitter.js:72:22)
    at Connection._onMessage (/Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:115:18)
    at WebSocket.<anonymous> (/Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/puppeteer/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:13:32)
    at WebSocket.onMessage (/Users/peterbe/dev/MOZILLA/MDN/yari/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:329:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@peterbe
Copy link
Contributor Author

peterbe commented May 4, 2021

I tried downgrading to puppeteer 9.0.0 and it seems to make this better.
The word "target" (in the error) seems very possibly related to puppeteer/puppeteer#7192 which also talks about "target" at lot. 🤷🏻‍♂️

peterbe added a commit to peterbe/yari that referenced this issue May 4, 2021
peterbe added a commit that referenced this issue May 4, 2021
* Weird test failures related to puppeteer

Fixes #3694

* tell dependabot to not upgrade puppeteer 9.x automatically

* specific about 9.1.x
peterbe added a commit to peterbe/yari that referenced this issue Jun 1, 2021
* Weird test failures related to puppeteer

Fixes mdn#3694

* tell dependabot to not upgrade puppeteer 9.x automatically

* specific about 9.1.x
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 a pull request may close this issue.

1 participant