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

If even 1 test fails, tests fail to load Test discovery failed: Process exited with non-zero status code 1 (Click to show log) #56

Closed
Charuru opened this issue Oct 24, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@Charuru
Copy link

Charuru commented Oct 24, 2022

Describe the Bug

Test explorer shows red ! with :Error on the sidebar instead of tests when starting VSCode. Popup says Test discovery failed: Process exited with non-zero status code 1 (Click to show log).

I think I see the tests running on the sidebar normally, after a few seconds all the tests disappear and are replaced with the Error.

Steps to Reproduce the Behavior

  1. Have a failing test
  2. Restart VSCode
  3. Check the test explorer sidebar, wait a few seconds
  4. red ! with :Error

Describe the Expected Behavior

The sidebar to show the tests with green and red tests as normal.

Provide Debug Logs

logs

Screenshots

Please Provide the Following Information

  • OS: OSX
  • Environment: (e.g. Dev Container
    with Guest OS and version)
  • Node Version: v16.17.0
  • VS Code Version: 1.72.2
  • Karma Version: 6.4.1
  • Frameworks: Jasmine
@Charuru Charuru added the bug Something isn't working label Oct 24, 2022
@Charuru
Copy link
Author

Charuru commented Oct 24, 2022

This bug seems to be new in 0.7, downgraded to 0.6.1 works fine.

@Charuru
Copy link
Author

Charuru commented Oct 24, 2022

Actually do not need to go back so far, 0.7.3 works correctly.

@lucono
Copy link
Owner

lucono commented Oct 25, 2022

@Charuru I'm not able to reproduce this issue with the latest version, 0.7.5. Can you create and share a minimal project repo that reproduces the issue?

@lucono
Copy link
Owner

lucono commented Oct 31, 2022

Thanks @Charuru. I was able to reproduce the issue consistently with your sample project and when using the jsdom browser, and across all recent versions of the extension, including v0.7.3. I am not however, able to reproduce it with the extension default chrome browser for any of the recent extension versions, including the latest version and v0.7.3.

The issue seems to be with jsdom, where it fails when karma tries to trigger the initial test discovery /run request to fully populate the project tests into the test explorer view.

Are you able to reproduce the issue with Chrome, Firefox, or any other browser?

@Charuru
Copy link
Author

Charuru commented Oct 31, 2022

@lucono Thanks for trying it, doesn't make a difference on my machine whether I use jsdom or ChromeCanaryHeadless. Same behavior.

@Charuru
Copy link
Author

Charuru commented Oct 31, 2022

Also, if I click on "Retry Test Load" it will keep on erroring, but if I save the test and it autoruns then the explorer will populate correctly.

I don't know if this is useful information, but when I click on the refresh button on test explorer, I see the tests being runned, all the logs, etc are as expected, and the tests show up for a moment before disappearing in place of the error and then Failed to load tests - Test discovery failed: Process exited with non-zero status code 1. This is ChromeCanaryHeadless.

@Charuru
Copy link
Author

Charuru commented Oct 31, 2022

Changing to HTTP from CLI fixed this too.

@Charuru Charuru closed this as completed Oct 31, 2022
@lucono
Copy link
Owner

lucono commented Oct 31, 2022

I see, thanks for the update. The karmaTestExplorer.testTriggerMethod setting is indeed experimental. In fact, its http option is stable, but the cli trigger method is actually what's experimental, so I'm not surprised that you ran into issues using that option.

Glad you were able to identify the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants