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

"Starting watch mode" never finishes & test indicators' state never changes. #316

Closed
zeroEvidence opened this issue Apr 28, 2018 · 28 comments
Labels

Comments

@zeroEvidence
Copy link

Hello,

I'm not sure if I'm the only one experiencing this, but this extension never finishes the "Starting watch mode" phase. Although, all of tests run, but the pass/fail indicator next to the test in the editor never changes from an unfilled green circle to the failed or pass state.

Other than that it's been working very well.

Thanks for a great extension, it's been very helpful, I appreciate the time and work that you've put into it.

Kindest regards.

Environment

  1. node -v: v8.11.1
  2. npm -v: 6.0.0
  3. npm ls react-scripts (if you haven’t ejected):
@goldberg/[email protected] /home/moored/workspaces/au.net.dmdigital.gitlab/goldberg/libraries/bare-base
└── (empty)
  1. Operating system:
$ cat /proc/version
Linux version 4.10.0-38-generic (buildd@lgw01-amd64-059) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017

$ lsb_release -a
Distributor ID:	LinuxMint
Description:	Linux Mint 18.3 Sylvia
Release:	18.3
Codename:	sylvia

$ cat /etc/debian_version
stretch/sid

Steps to Reproduce

  1. Clone repo: https://github.com/zeroEvidence/bare-base
$ npm install
  1. Open workspace with vscode v1.22.2, or 1.22.1, or 1.21.1
  2. Disable all extensions except for vscode-jest

Expected Behavior

vscode-jest extension should finish initising watch mode and the test indicators should change state

Actual Behavior

vscode-jest extension "starting watch mode" runs forever.

VSCode developer console log

-1524874876899.log

@seanpoulter seanpoulter added topic: core Running tests and showing results bug labels Apr 28, 2018
@zeroEvidence
Copy link
Author

Update:
The above behaviour ceased in one of my projects. I am now testing the same project as the repo provided. So far, no luck. But I'll keep it running in the background to see if it changes.

@zeroEvidence
Copy link
Author

I've figured out that this issue happens if jest is upgraded to one of their early v23 releases.
Downgrading to the latest v22 resolves this issue.
Albeit, I could've sworn that vscode-jest was working with v23.0.0-alpha.0 the other day. :-/
This issue may be indicative that there might be issues with vscode-jest v2.7.0 and jest v23.

@abner
Copy link
Contributor

abner commented May 12, 2018

I think it would be related to jestjs/jest#6025

@abner
Copy link
Contributor

abner commented May 12, 2018

I think it would be fixed if we change in src/JestProcessManagement/JestProcess.tsfile, at line 26:

this.runner.start(this.watchMode)

to

this.runner.start(this.watchMode, this.watchMode)

basically this is passing the same boolean this.watchModeto parameter watchAll.

I changed this locally and tested the scenario @zeroEvidence mentioned and it just fixed it.

I just submited a pull request: #325

@wmertens
Copy link

If #325 made it into 2.7.2 (not clear to me), it's not working for me in any case - still waiting forever to start watch mode while it obviously is in watch mode in the output.

@dhoulb
Copy link

dhoulb commented May 30, 2018

I'm experiencing this issue with Jest 23.0.1. If I downgrade to 22.x it works correctly again.

Currently using 2.8.0 of VSCode Jest. Same issue @wmertens describes — status never changes from "Starting watch mode" and status dots and inline errors etc never appear. But Jest channel output appears to be working correctly in watch mode.

@wmertens
Copy link

wmertens commented May 30, 2018 via email

@crazy4groovy
Copy link

I'm experiencing this issue with "jest": "^23.1.0"

@prophet60091
Copy link

prophet60091 commented Jun 12, 2018

Started happening for me too out of the blue about a week ago. I'm on Jest-cli:^23.1.0, node 9.4.

@abner
Copy link
Contributor

abner commented Jun 14, 2018

here just worked affter downgrade to jest 22

@abner
Copy link
Contributor

abner commented Jun 14, 2018

about this issue, there is another trick behavior when using --watch. The steps to reproduce are:

  • since we have no changes in the repository, if i change the test or code and it fails, the red dot appears;
  • if i revert the change or the code, and the files came back to the exact previous state already commited, because of the --watch, this test will not run and the red dot will remain there in the editor.

@prophet60091
Copy link

prophet60091 commented Jun 14, 2018

I can't even get them to turn red...I have only empty greens.

edit: But I can also confirm that a downgrade to 22.4.4 worked

@dortamiguel
Copy link

There is a fix for this?

@seanpoulter
Copy link
Member

Not yet @ellipticaldoor. Does anyone have time to investigate why this is only an issue on Jest v23? If you have any questions getting the extension set up to debug send me a message.

@andywillis
Copy link

FYI I get this with "initial full test". Reverting to 22.4.4 stopped the error.

@connectdotz
Copy link
Collaborator

I digged into this a little bit tonight, looks like the hanging watch mode is caused by (facebook/jest#4858), which caused the test results output messaging moved from stdout to stderr for the Runner. Sine vscode-jest (jest-editor-support to be precise) relies on this message on stedout to kick off test result parsing, it therefore hangs indefinitely...

I will submit PRs (both jest-editor-support and vscode-jest) this weekend to address this root cause.

@mikeesouth
Copy link

Any update here? Does it require json output of coverage report or does it rely on some other format that I have to include? I'm using jest 23.3.0 and VSCode 1.25.0, it never leaves " Starting watch mode". My tests pass but I only get a green unfilled icon and no coverage info in tested files.

@endyjasmi
Copy link

endyjasmi commented Jul 12, 2018

@mikeesouth The fix I am using is npm i -D jest@22 babel-jest@22

@mikeesouth
Copy link

@endyjasmi thanks but it doesn't help me. You have a typo in babel-jest but I tried downgrading jest, babel-jest and ts-jest but it still spins on "Starting watch mode" in my VS Code. I have disabled autoenable of the jest plugin while waiting for a fix or workaround.

@john-rochester
Copy link

I believe that you also need jest-cli@22

@mikeesouth
Copy link

@john-rochester hah, that solved it. I searched for -jest in my package.json so I missed jest-cli. Lazy :)

@connectdotz
Copy link
Collaborator

vscode-jest 2.9.0 has shipped with jest 23.x support, which should address this issue. Feel free to reopen if otherwise.

@pavel-mikhalchuk
Copy link

pavel-mikhalchuk commented Oct 6, 2018

@connectdotz, hey! I've just installed 2.9.2 version and this issue is still re-produced. Here's my package.json:

{
  "name": "money-portal-be",
  "version": "0.1.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "date-and-time": "^0.6.2"
  },
  "devDependencies": {
    "aws-sdk-mock": "^4.2.0",
    "eslint": "^5.6.1",
    "eslint-config-airbnb-base": "^13.1.0",
    "eslint-config-prettier": "^3.1.0",
    "eslint-plugin-import": "^2.14.0",
    "jest": "^22.4.4",
    "jest-cli": "^22.4.0",
    "babel-jest": "^22.4.0"
  },
  "scripts": {
    "test": "jest"
  },
  "repository": {
    "type": "git",
    "url": "git+https://bitbucket.org/pavelmikhalchuk/money.git"
  },
  "author": "Pavel Mikhalchuk",
  "license": "ISC",
  "homepage": "https://bitbucket.org/pavelmikhalchuk/money#readme",
  "jest": {
    "testPathIgnorePatterns": [
      "<rootDir>/dist/"
    ],
    "testEnvironment": "node"
  }
}

Please let me know if you need any other info or you want me to create another GitHub issue for that.

Thanks!

@adover
Copy link

adover commented Oct 11, 2018

This was the same for me running 2.9.1 and Jest 23.6.0 on an Angular app. Make sure you run Jest from the command line to ensure you dont have any config issues. I spotted a few there.

@tomitrescak
Copy link

Happening on Jest 24.1.0, what version should I donwngrade to ? Thanks!

@blikblum
Copy link

Hit the issue with v 2.9.2 and jest 24.8.0 on windows

Should this config be responsible?:

"jest.pathToJest": "npm run test --"

Using it as a workaround for other issue: #426

@dominik-fielmann
Copy link

I have the exact same problem under Ubuntu 20.04 with jest 26.5.2 - is this a regression?

@connectdotz
Copy link
Collaborator

I have the exact same problem under Ubuntu 20.04 with jest 26.5.2 - is this a regression?

not that we are aware of... Feel free to open a new issue with more details.

legend1202 pushed a commit to legend1202/vscode-jest that referenced this issue Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests