Commit graph

1945 commits

Author SHA1 Message Date
Karthik Nadig
ed565b2d05
Turning suspend all policy and using get stack trace command (#731)
* Continue resumes all threads

* Enable suspend policy ALL

* stacktraces and active exceptions are no longer stored

* stacktraces and active exceptions are no longer stored

* Fix set breakpoints tests

* Fix exception info

* Fix breakpoint tests

* Fix exception breakpoint tests

* Fix syntax

* Fix exception info

* Fix syntax

* Fix Stack trace tests

* Fix for 2.7

* Minor refactor

* Fix ContinueTests

* Fix ExceptionInfoTests

* Enable more tests

* Remove tests that are now no-ops

* Minor tweaks

* Fix test_attach_breakpoints

* typo

* More tweaks

* Send error response for unknown threads

* Use assert_contains in continue tests

* Add some TODOs
2018-08-07 11:40:33 -07:00
Karthik Nadig
bd1d1aa6b8
Uncomment some test code. (#736) 2018-08-07 10:46:06 -07:00
Karthik Nadig
e6865adac5
Remove redirect output timeout (#734) 2018-08-06 10:42:01 -07:00
Karthik Nadig
dbf3d60499
Fix for test_setup failure in python 3.7 (#733)
* Logging to find VSTS issue with test_setup

* Fix for test_setup issue

* Remove unused import
2018-08-05 11:04:59 -07:00
Fabio Zadrozny
0a773785f0 Stop showing message. #719 (#729) 2018-08-02 13:30:13 -07:00
Karthik Nadig
53e421a101
Clean up template breakpoints on detach (#713) 2018-08-02 12:43:57 -07:00
Fabio Zadrozny
46eef12aa9 Provide stack trace of uncaught exception on CMD_GET_THREAD_STACK (#697). (#710) 2018-08-01 22:01:56 -07:00
Karthik Nadig
522e9f1ce4
Fixes some bugs with just-my-code (#727)
* Continue if the suspended in debugger code

* Get more info via exception description

* More logging

* Add a check for site-packages

* Remove debug logs and cleanup

* Fix tests

* Fix more test bugs

* more cleanup
2018-08-01 19:40:34 -07:00
Don Jayamanne
f726968304
Fix blocking enable_attach and breaking on the main thread in remote debugging (#706)
Fixes #545, #711, #712 
More tests to be written as part of #718 

Summary of solution:
* For remote attach, spin up pydevd (use `install`) 
* In a separate thread wait for connections (within a loop, to support multiples)
* Ensure only one connection is supported at a time
* Use a simple event to ensure we have a single session at a time (we won't accept more than one connection if even is set)
* Use a simple event to detect when a handshake has been successfully been done

![image](https://vignette.wikia.nocookie.net/steven-universe/images/3/35/86036-victory-dance-gif-Despicable-M-EPnS.gif/revision/latest?cb=20150727031515)

@karthiknadig 
I've basically reverted the way `enable_attach` works.
This allows breaking into the current thread without any issues.
Not sure what else it breaks, lets see how the tests go.

Lets talk about the changes, hacks/solutions tomorrow.
Easy fixes, just need some simple locks!!
2018-08-01 13:00:14 -07:00
Karthik Nadig
4a4e76e6d9
Enable stop on entry feature (#702) 2018-07-31 14:52:18 -07:00
Don Jayamanne
1ec66105e1 Remove unwanted parameter and re-assigning of it (#709) 2018-07-31 12:58:24 -07:00
Karthik Nadig
c495e3749e
Fix issue with attach to remote machine (#703) 2018-07-30 15:25:13 -07:00
Fabio Zadrozny
f712369515 Provide a CMD_STOP_ON_START (#231), fix issues on path separator, refactor wait_for_breakpoint in tests. (#700) 2018-07-30 13:09:05 -07:00
Fabio Zadrozny
e5027cb5a5 Added Python 3.7 support and fixed issues related to Jython on Travis. (#692) 2018-07-28 10:25:57 -07:00
Karthik Nadig
75e53eed24
Django and Flask system test (#689)
Fixes #675 #674
* Flask system tests initial

* Enable route and template breakpoint tests.

* Fix typo

* Remove wait for thread exit

* Few more tweaks

* More tweaks

* Try adding LC_ALL utf-8

* Add more tests

* Remove flask version pinning

* Rename and move flask tests to make room for django tests

* Switch to using requests

* Fix line number in attach

* Add django to packages

* Add Django tests

* Tweaks to django test

* Remove hardcoded port
2018-07-26 15:13:59 -07:00
Fabio Zadrozny
d997742419 Fix 72 break suspension policy (#673)
* #72: Provide a way to set breakpoint suspension policy.

* Provide a CMD_GET_THREAD_STACK (#72).
2018-07-23 15:20:13 -07:00
Karthik Nadig
5db5b30ea8
Add unhandled exception tests (#682)
Adds unhandled exception tests #654
Fixes a bug in _io.py that caused JSONDecodeError in tests sometimes #683
Fixes a issue for some cases where the tests were timing out on windows
2018-07-23 13:23:04 -07:00
Don Jayamanne
501d163c5c System Tests for unhandled exceptions (#669)
* tests for unhandled exceptions

* Test source and fix linter issues
2018-07-23 10:25:10 -07:00
Karthik Nadig
bf8375830d
Update debug protocol json to latest (#676) 2018-07-18 10:31:10 -07:00
Fabio Zadrozny
f8d324a4fc #653: unhandled exceptions no longer reported twice. (#671) 2018-07-18 10:12:48 -07:00
Eric Snow
c99f884ae0
Revert "Revert "Do not wait for settrace() to finish until wait_for_attach(). (#628)" (#666)" (#670)
(helps #545)

This reverts commit 80d86b9.

Note that this still suffers from the caveat that if attach doesn't happen within a second (and wait_for_attach() isn't called) then the main thread will never have debugging enabled. One way or another that will need to be addressed.
2018-07-17 14:25:53 -06:00
Karthik Nadig
475a2d1513
Add thread count tests (#668)
* Add thread count tests

* Fix Linter

* Adding sleep to allow thread state to be captured accurately
2018-07-16 22:43:07 -07:00
Don Jayamanne
80d86b961d
Revert "Do not wait for settrace() to finish until wait_for_attach(). (#628)" (#666)
This reverts commit c816752aff.
2018-07-16 18:44:34 -07:00
Fabio Zadrozny
2edf4df6d2 #657: Fixed pydevd_file_utils dealing with .zip/.egg paths. (#660) 2018-07-16 15:44:09 -07:00
Karthik Nadig
42408e08b2
Add test with no output (#664) 2018-07-16 15:41:43 -07:00
Eric Snow
c816752aff
Do not wait for settrace() to finish until wait_for_attach(). (#628)
(helps #545)

We move the settrace() into a thread, but make sure to wait for the thread to finish in wait_for_attach().

My only concern with the solution is that the current thread will not get debugged if enable_attach() is called but wait_for_attach() is not (and no attach happens right away). I'm going to address this in a follow-up PR by monkey-patching sys.settrace temporarily.
2018-07-16 14:51:33 -06:00
Don Jayamanne
76c40c0dc0
Wait for program to run to completion to fix issue with live exception tests (#650)
Fixes #614
2018-07-13 09:42:20 -07:00
Karthik Nadig
b255ebc3a8
Update upstream metadata for debug protocol (#652) 2018-07-13 00:34:52 -07:00
Karthik Nadig
d32118074b
Fix pathutils issue with relative paths and use mixed-case test path name in test. (#647) 2018-07-12 13:28:17 -07:00
Karthik Nadig
13b7827517
Updating schema to the latest. (#651) 2018-07-12 13:27:12 -07:00
Don Jayamanne
14fdadf770
Increase connection timeouts in tests (#646)
Fixes #631
* PTVSD takes a while to load, hence having a timeout of 1.0 is not sufficient.
* Increased time to 5.0 as that'll give it plenty of time to load.
* why 5s instead of 2s, simple, why not 5s instead of 2s.
2018-07-12 10:43:03 -07:00
Don Jayamanne
3c29eeeab7
Add timeouts for thread.joins to ensure it does not block indefinitely (#644)
* Add timeouts for thread.joins (this is the main change)
* Format errors captured and displayed (for py27 and 3 compatibility)
* Format code (this accounts for 95% of the changes, was tired of linter errors, hence formatted code using autpep8)
2018-07-12 01:01:25 -07:00
Fabio Zadrozny
96cbec8522 Fixes #593: _DuplicateWriter' object has no attribute 'buffer' (#641) 2018-07-11 13:35:55 -07:00
Fabio Zadrozny
e9ed23fe75 Fixed #481: JustMyCode debugging not working in VS Code when virtualenv is inside workspace. (#640) 2018-07-11 13:35:31 -07:00
Don Jayamanne
6017f03022
Revert "Use sys.exit() instead of os.kill(). (#538)" (#634)
This reverts commit bd390322a8.
Fixes #633
Fixes #618
2018-07-11 12:58:49 -07:00
Don Jayamanne
4ab7920628
Use a unique port for system tests (#632) 2018-07-10 18:26:43 -07:00
Don Jayamanne
14982d90ba
Fix path mappings with remote debugging (#624)
Fixes #610
2018-07-10 15:09:16 -07:00
Fabio Zadrozny
2b0140e22c Fix for #620: Mix of unicode and str in filename conversion. (#621) 2018-07-10 10:35:11 -07:00
Eric Snow
10af45bccc
A bunch of cleanup/lint fixes for the system tests. (#625)
The system tests have a number of minor formatting and structural issues that would be better to clean up sooner rather than later. This PR addresses nearly all of them.
2018-07-09 17:14:57 -06:00
Eric Snow
b25d654987
Do not check __main__.__file__ under -m. (#619)
(fixes #592)

Under certain circumstances, __main__ is a "builtin" module. Such modules do not have a __file__ attribute. Consequently, this caused the pydevd injection code to fail. This PR fixes that.
2018-07-09 12:04:42 -06:00
Don Jayamanne
2bc5b2c976
Tests for attaching by host names (#613)
* Attach tests
* linter issues
* Disable test
2018-07-07 00:11:14 -07:00
Karthik Nadig
8d140b2d03
Add hit condition tests (#601)
* Add hit conditon tests

* Handle potential race condition.
2018-07-06 22:58:53 -07:00
Don Jayamanne
ab34316cc9
Refactor test classes in system tests (#612) 2018-07-06 20:53:12 -07:00
Karthik Nadig
852f4dbb0f Fixes a bug that forced host to always be localhost. (#611)
#578
2018-07-06 20:52:19 -07:00
Don Jayamanne
d438548e93
Do not send terminated event when restarting (#604)
Fixes https://github.com/Microsoft/ptvsd/issues/603
2018-07-06 18:25:00 -07:00
Derek Keeler
e33688d52b
Update verbosity when we create junit-style output report files (#608) 2018-07-06 15:56:48 -07:00
Karthik Nadig
0be3795eb4
Some pathutils fixes (#589)
* Fix pathutil tests

* Handle IndexError in pathutils
2018-07-06 13:08:34 -07:00
Fabio Zadrozny
6b20c67794 Fixes deadlock when creating thread. (#591) 2018-07-05 18:10:15 -07:00
Don Jayamanne
867bdd3bd5
System tests for logpoints 2018-07-05 17:26:05 -07:00
Don Jayamanne
1ffabd204d
System tests for conditional breakpoints 2018-07-05 17:11:47 -07:00