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

release the process in ember test helper #9346

Merged
merged 1 commit into from Oct 8, 2020

Conversation

ro0gr
Copy link
Contributor

@ro0gr ro0gr commented Oct 1, 2020

for some reason we have sporadic test failures on CI, like:

process already captured

This is quite hard to reproduce and the root cause of such a failure is not clear at the moment.

This commit is an attempt to provide an alternative to #9337, so with this we do not touch will-interrupt-process, and try to fix it in the tests land only.

for some reason we have sporadic test failures on CI, like:

 > process already captured

This is quite hard to reproduce and the root cause
of such a failure is not clear at the moment.

This commit is an attempt to provide an alternative to ember-cli#9337,
so with this we do not touch `will-interrupt-process`,
and try to fix it in the tests land only.
@ro0gr
Copy link
Contributor Author

ro0gr commented Oct 1, 2020

tbh, I'm not sure if I interpret the current stacktraces correctly:

not ok 84 Acceptance: ember new ember new npm blueprint with old version
process already captured at:

Error
at Object.capture (/Users/runner/work/ember-cli/ember-cli/lib/utilities/will-interrupt-process.js:32:32)
at module.exports (/Users/runner/work/ember-cli/ember-cli/lib/cli/index.js:72:24)
at ember (/Users/runner/work/ember-cli/ember-cli/tests/helpers/ember.js:68:17)
at Context. (/Users/runner/work/ember-cli/ember-cli/tests/acceptance/new-test.js:144:11)
at callFn (/Users/runner/work/ember-cli/ember-cli/node_modules/mocha/lib/runnable.js:374:21)
at Test.Runnable.run (/Users/runner/work/ember-cli/ember-cli/node_modules/mocha/lib/runnable.js:361:7)
at Runner.runTest (/Users/runner/work/ember-cli/ember-cli/node_modules/mocha/lib/runner.js:619:10)
at /Users/runner/work/ember-cli/ember-cli/node_modules/mocha/lib/runner.js:745:12
at next (/Users/runner/work/ember-cli/ember-cli/node_modules/mocha/lib/runner.js:536:14)
at /Users/runner/work/ember-cli/ember-cli/node_modules/mocha/lib/runner.js:546:7
Error: process already captured at:

Error
at Object.capture (lib/utilities/will-interrupt-process.js:32:32)
at module.exports (lib/cli/index.js:72:24)
at ember (tests/helpers/ember.js:68:17)
at Context. (tests/acceptance/new-test.js:144:11)
at Object.capture (lib/utilities/will-interrupt-process.js:24:13)
at module.exports (lib/cli/index.js:72:24)
at ember (tests/helpers/ember.js:68:17)
at Context. (tests/acceptance/new-test.js:144:11)

The first stacktrace is supposed to show the initial capture's origin, and then in the second stacktrace it is just a regular Error stacktrace.

The second one seems to be more interesting to me for this specific failure. It looks like the same line of the test(new-test.js:144) invokes ember test helper twice. I have no idea how it's possible, but in case if that's the truth, I'm not sure if the this PR works around the issue at all. However, I'd still like to try it out, if possible, before doing #9337.

@ro0gr
Copy link
Contributor Author

ro0gr commented Oct 1, 2020

@rwjblue
Copy link
Member

rwjblue commented Oct 8, 2020

The second one seems to be more interesting to me for this specific failure. It looks like the same line of the test(new-test.js:144) invokes ember test helper twice. I have no idea how it's possible, but in case if that's the truth, I'm not sure if the this PR works around the issue at all. However, I'd still like to try it out, if possible, before doing #9337.

One thing to keep in mind, is that our mocha setup automatically "retries" (IIRC 2x).

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

Happy to give it a try, thanks for helping out here!

@rwjblue rwjblue merged commit 494a907 into ember-cli:master Oct 8, 2020
@ro0gr
Copy link
Contributor Author

ro0gr commented Oct 8, 2020

One thing to keep in mind, is that our mocha setup automatically "retries" (IIRC 2x).

ah.. this may explain the stacktrace. If such, I think this commit should solve the issue 🤞

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

2 participants