Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixes #3530: codelens test run works without exception. #3577

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

Closed
wants to merge 2 commits into from

Conversation

cwharris
Copy link

@cwharris cwharris commented Dec 6, 2018

Fixes #3530

Updates sys.exit(...) to os._exit(...), which is similar but does not raise a SystemExit exception, thus allowing CodeLens to finish without the debugger breaking on exit.

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Unit tests & system/integration tests are added/updated
  • Test plan is updated as appropriate
  • package-lock.json has been regenerated by running npm install (if dependencies have changed)

Updates `sys.exit(...)` to `os._exit(...)`, which is similar but does not raise an exception before exiting.
@msftclas
Copy link

msftclas commented Dec 6, 2018

CLA assistant check
All CLA requirements met.

@d3r3kk
Copy link

d3r3kk commented Dec 8, 2018

Thanks for the PR @cwharris. We will review this PR and have feedback for you by the end of our next sprint (end of December), at the very latest.

@DonJayamanne
Copy link

@brettcannon
This looks ok to me. What do you think?

@DonJayamanne DonJayamanne self-requested a review December 17, 2018 15:49
@DonJayamanne
Copy link

The only problem is we don't have any functional tests for these. Apart from that all seems to be good. As for adding functional tests I believe that will be difficult, as the tests would require launching the debugger, etc.

@DonJayamanne
Copy link

@cwharris Thanks for the PR, however we cannot accept this solution.
Using os._exit will bypass atexit handlers and the like, and that's not something we want, as this has the potential to impact user code.
Once again, thanks for the PR.

@cwharris
Copy link
Author

@DonJayamanne This code is causing behavior we don't want. Would you rather use a catch-all and return?

@brettcannon
Copy link
Member

@cwharris if that results in proper behaviour then switching to return is fine.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code lenses disappear when debugging tests with sys.exit(0)
5 participants