vscode: VS Code often does not close after test runs complete
For the last few weeks, my automated test runs have been intermittently (but very frequently) hanging after the tests complete. Mocha writes that the tests completed, with the number of passes, but the VS Code process never terminates, so on Travis we end up with something like:
✓ Dart: New Project can be invoked and creates trigger file
3 passing (5s)
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated
When it works, the next line printed after x passing
would be Exit code: x
which is printed by vscode-test
.
I added some code to log before the callback passed into the test runner is called, as well as logging if the process is still alive after 10 seconds:
And the output now looks like:
3 passing (3s)
Test run is complete! Calling VS Code callback with (null, 0)
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
This suggests that Mocha is correctly finishing the run, and that the test runner code (which I adapted from https://github.com/microsoft/vscode-test/blob/master/sample/test/suite/index.ts) is correctly calling the callback, and the extension host is disappearing within 10 seconds (since it didn’t print the second line), yet VS Code never quit so the CI build just hung.
I tried passing --verbose
to Code, and then the output ended like this:
Test run is complete! Calling VS Code callback with (null, 0)
[main 2019-10-16T07:52:02.179Z] IPC#vscode:exit 0
[main 2019-10-16T07:52:02.180Z] Lifecycle#kill()
[main 2019-10-16T07:52:02.181Z] Lifecycle#window.on('closed') - window ID 1
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
So my guess is that either
- VS Code is not terminating; or
- The
close
event is not firing invscode-test
so it never completes its promise.
I spent a lot of time last week and this week trying to diagnose this, but I feel like I’m running out of ideas. I am completely unable to reproduce it locally (and as far as I can tell, it only happens on macOS on Travis - I don’t think I’ve seen it on Linux).
I’m trying to make a smaller repo that has this issue (my test runs are quit big and involve downloading SDKs), but I figured it was worth opening an issue in case others are seeing it, or you have any suggestions on how to track down.
Edit: Repro is further down in the comments.
I don’t know if it’s related (wouldn’t explain why it’s intermittent), but the example test runner script on the website is very different to the one in the sample repo (one returns a promise, the other takes a callback). I couldn’t find any explanation for the difference.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 22 (19 by maintainers)
Commits related to this issue
- Disable macOS bots due to VS Code bug These frequently hang after the test run completes and it's not clear why (see https://github.com/microsoft/vscode/issues/82676). — committed to Dart-Code/Dart-Code by DanTup 5 years ago
- Disable macOS bots due to VS Code bug These frequently hang after the test run completes and it's not clear why (see https://github.com/microsoft/vscode/issues/82676). — committed to Dart-Code/Dart-Code by DanTup 5 years ago
- Enable insiders/dev builds, but exclude stable VS Code on macOS See https://github.com/microsoft/vscode/issues/82676. — committed to Dart-Code/Dart-Code by DanTup 5 years ago
Hard to say for certain because on Travis I often hit a 50min limit (integration tests are sloooow) and GH actions has weird issues where it shows builds still running after a week (and sometimes it won’t show the output of the test run)…
I think it may be fixed (at least ignoring the unrelated “VS render process crashed” error above which seem pretty common on Windows). I’ll likely be digging through test results more this week so feel free to close this and I can shout back if I come across builds that suggest it’s still happening.
Glad to hear it’s not just me! Not having test run results is painful! I’ve had to disable macOS everywhere for now. I’m not sure why Code isn’t seeing this in its own test runs though (maybe it is, but I would expect it would be picked up pretty quick if so).
I don’t really know the best way to debug this - I’m not very familiar with Electron (or macOS). Probably needs some input from someone else (hopefully the Code team).
This happens on GitHub Actions macOS too, not only Travis.