You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect the code to break at the debugger line in ./add.js.
Actual behavior
The code did not break.
Additional context
I run the above steps in a virtual machine. I connect to the VM from my terminal with a SSH tunnel localhost:9222 -> 0.0.0.0:9222.
I have not checked if the problem occurs without the SSH tunnel because I am using a virtual machine so I do not have to install NodeJS on my machine's OS.
But I guess this problem is specific to this context, and is related to this change in version 29.6.0:
[jest-core] Always use workers in watch mode to avoid crashes (#14059)
Indeed, the code breaks when removing --watchAll from the command line arguments.
Seems like you are right about #14059. After it landed workers are used always instead of sometimes in watched mode. This means that your reproduction now fails always, but before it was failing sometimes. If I didn’t miss something. Might be that all worked as expected with --runInBand flag, but you are not mentioning it. (EDIT: Nope, see #6683)
All examples in debugging documentation use the --runInBand flag. The CRA example additionally sets --watchAll=false.
The configuration examples in vscode-jest repo also set --runInBand and --watchAll=false.
All this makes me think that it can be that the watch mode is not designed to work with debugger. For some reason. Can’t proof that.
@benjaminjkraft Could you take a look? I can’t recall if we did talk about respecting --runInBand in the watch mode? Does that make sense? (Sorry about the noise, I forgot about #14085.)
So the watch mode and debugging tools only worked together if --runInBand is set or if only one available core is detected? Curious to know why. There is nothing in the current version (v29.5.0) of the documentation about this.
The VM I am running Jest in has only one core (Virtual Box's default) therefore it always worked.
edit: there is a note explaining why --runInBand is somewhat mandatory for debugging, and #14085 seems to address my issue, therefore I am closing it.
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.
Version
29.6.1
Steps to reproduce
node --inspect-brk=0.0.0.0:9222 ./node_modules/.bin/jest --watchAll
(npm test
)chrome://inspect/
in Chromeinspect
in the target listExpected behavior
I expect the code to break at the
debugger
line in./add.js
.Actual behavior
The code did not break.
Additional context
I run the above steps in a virtual machine. I connect to the VM from my terminal with a SSH tunnel
localhost:9222
->0.0.0.0:9222
.I have not checked if the problem occurs without the SSH tunnel because I am using a virtual machine so I do not have to install NodeJS on my machine's OS.
But I guess this problem is specific to this context, and is related to this change in version
29.6.0
:Indeed, the code breaks when removing
--watchAll
from the command line arguments.Environment
System: OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm) CPU: (1) x64 Intel(R) Core(TM) i7-3612QM CPU @ 2.10GHz Binaries: Node: 20.3.0 - /usr/bin/node npm: 9.6.7 - /usr/bin/npm npmPackages: jest: ^29.6.1 => 29.6.1
The text was updated successfully, but these errors were encountered: