Yes
Yes
node -v: 6.9.1npm -v: 4.6.1npm ls react-scripts (if you haven’t ejected): 1Then, specify:
(Write your steps here:)
Unit tests would execute
Consistently get:
"Test run was interrupted."
Tough to come up with a case. I did notice that adding --runInBand seems to work fine (though slower).
I'm thinking this is due to my Anti Virus, and is likely an issue with Jest, however, since everyone here works with similar configurations, I figured I'd start here before posting over there.
Unfortunately, I can't prove out my AV theory, as I need my IT team to allow me to stop it.
Thanks for report!
Can you check if it reproduces on a newly created project?
It would also help to see a screenshot.
I attempted with a new CRA app, and it seemed to work fine, I think it needs a larger test suite.
Here's a screenshot:

Can you try in a different terminal? The test run gets interrupted if you press one of these keys below. Maybe something is triggering a keypress?
It's pretty consistent.
Here it is from git bash. Note that it runs fine if I --runInBand.

cc @cpojer have you ever seen this?
This should only happen when you press a key in the same terminal window while the test is running. Any key will kill the test run.
I'm seeing this too. Sometimes works if I resize the console window, but inconsistently. By chance is anyone else with this problem using "Cmder"?
@mrjpierce I'm also using Cmder and getting this every time I try to trigger a test run. Tests run fine when triggered by a file watch though.
If you put some console.logs into Jest code that interrupts test run (not sure where it is, but you can find it somewhere in jest-cli I think) you can probably see what triggers it. Maybe Cmder produces a stray unintended keystroke or something.
@TheTFo Can you confirm you also use Cmder?
I use ConEMU.
On Sun, Jul 9, 2017, 2:39 PM Dan Abramov notifications@github.com wrote:
@TheTFo https://github.com/thetfo Can you confirm you also use Cmder?
—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/facebookincubator/create-react-app/issues/2649#issuecomment-313937457,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAgWoDK5w9z4YB69Ehv32Th4fBsCz-Bsks5sMR5ogaJpZM4OHRuS
.
That’s good to know, thanks. I’m tagging this as needing contributions so somebody can investigate. If nobody finds the time, I might be able to look into this in a month or so.
Specifically: we need someone to reproduce the issue with either Cmder or ConEMU on Windows, and then determine what’s causing it.
We track an issue, which might be related: https://github.com/facebook/jest/issues/3849 (Bitdefender Antivirus is to blame)
@TheTFo @tristan-shelton @mrjpierce
Can either of you confirm whether you use Bitdefender Antivirus?
I'm using CylanceProtect. I'm curious if there's a way to confirm an AV is
the issue if we can't disable it temporarily.
On Sun, Jul 9, 2017, 3:00 PM Dan Abramov notifications@github.com wrote:
@TheTFo https://github.com/thetfo @tristan-shelton
https://github.com/tristan-shelton @mrjpierce
https://github.com/mrjpierceCan either of you confirm whether you use Bitdefender Antivirus?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebookincubator/create-react-app/issues/2649#issuecomment-313941447,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAgWoMgJcikWmXrIWpiE2r2FM2NqFWidks5sMSNTgaJpZM4OHRuS
.
Using CMDER with McAffee on Win10. Happens if I try to trigger in watch mode, but runs fine if fired by a file change.
Hmm. We'll need someone to confirm whether this happens with Cmder alone, no antivirus.
Looks like Cmder/ConEmu is triggering an [Enter] key somehow which is setting the 'interrupted' state in testWatcher to true.
(jest-cli/build/watch.js)
(jest-cli/build/constants.js)
(Using react-scripts 1.0.7)
@markguckian Thank you so much for investigating! I think we can close this now, as the issue is not on our side.
Whoever is affected, please feel free to file an issue with Cmder/ConEmu about unexpected [Enter] keypresses which didn’t happen.
Just curious, did someone open issue in ConEmu/Cmder regarding this? Seems to still happen from time to time
Probably not. Do you want to do it?
Yeap, worth a try.
I'm not sure that I will be able to provide good track down of issue, though, since issue seems to be sporadic and happens only _sometimes_, and that "sometimes" usually starts to happen only after Jest works for a while and some good amount of watch events happens.
I was running into this issue as well, so I decided to do a little digging. I enabled the debugger under Info -> Debug and set it to log Input commands. I noticed that when you press enter, two events are logged:
D(1) VK=13, SC=28, U=(x000D), ST=x00000000
U(1) VK=13, SC=28, U=(x000D), ST=x00000000
I'm assuming one event is the keydown and the other is the key up. What I did find out, as an actual work around is that if you use Shift + Enter, it will work. I tested this while the interactive console is running, and it even works if you do npm run test and prest Shift + Enter.
TL;DR: Shift + Enter is a decent workaround.
Can anyone else try this and confirm it works for them as well?
@LukePettway Nope :( If you press any other keys, the ENTER key still triggered and that will not report in the debug log.
I have written a simple stdin node script and listen to the same data event, however that will NOT trigger ENTER key. It makes me so confuse if Jest or ConEmu bug.
** and the bash.exe under ConEmu is okay.
@KayLeung thanks for reporting back, it's weird, like it was working for a bit and then stopped. Oh well.
Most helpful comment
Yeap, worth a try.
I'm not sure that I will be able to provide good track down of issue, though, since issue seems to be sporadic and happens only _sometimes_, and that "sometimes" usually starts to happen only after Jest works for a while and some good amount of watch events happens.