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

Console output swallowed with parallel execution #6042

Closed
KevinGrandon opened this issue Apr 20, 2018 · 5 comments
Closed

Console output swallowed with parallel execution #6042

KevinGrandon opened this issue Apr 20, 2018 · 5 comments

Comments

@KevinGrandon
Copy link

Do you want to request a feature or report a bug?

Bug report

What is the current behavior?

Parallel execution will cause subsequent parallel tests to swallow console output.

Add the following to any jsdom/node test:

for (let i = 0; i < 10; i++) {
    console.log('OUTPUT ' + i);
    await new Promise(resolve => setTimeout(resolve, 100));
}

Add multiple tests so parallel runs happen while this test is running.

What is the expected behavior?

You will see 10 lines of console logging in standard out.

Note: Running with CI=true fixes the issue

Please provide your exact Jest configuration

Standard jest environment, using the multi-project runner.

Run npx envinfo --preset jest in your project directory and paste the
results here

  System:
    OS: macOS Sierra 10.12.6
    CPU: x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
  Binaries:
    Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
    Yarn: 1.6.0 - ~/.nvm/versions/node/v8.11.1/bin/yarn
    npm: 5.6.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
@KevinGrandon
Copy link
Author

Note: this is a similar issue to #2441, but I've added additional details around how parallelism will cause this. I'm trying to reproduce on a smaller repo, but running into other bugs around the concurrency heuristic in Jest.

@hdpinto
Copy link

hdpinto commented May 3, 2018

I noticed that console.log() gets swallowed but console.error() and console.warn() don't, particularly when using promises and making mocked API calls, if this is the same issue.

@tchakabam
Copy link

not sure if it helps anyone here, but am using Node v8.10.0, and while this wasn't working with Jest v21.x, after I upgraded to v23.1.0, it worked. This is regardless wether using parallel execution (on 25+ tests) or using the -i flag, or having --verbose or not. that being said, your issue might be a different one than the one I had. at least I can say that it "can" work :)

@SimenB
Copy link
Member

SimenB commented Feb 3, 2019

I think this was fixed by #6871 (available in Jest 24), so optimistically closing

@SimenB SimenB closed this as completed Feb 3, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants