Commit graph

15 commits

Author SHA1 Message Date
Pavel Minaev
095e5bcd5c Fix #1713: Adapter: multiple concurrent sessions 2019-10-30 17:12:17 -07:00
Pavel Minaev
89be0d1fce Reformat tests. 2019-10-03 18:31:37 -07:00
Pavel Minaev
c3d7d7a454 Test fixes. 2019-09-30 04:41:10 -07:00
Pavel Minaev
8f358d6e0f Refactor tests.debug to accommodate ptvsd.server spawning the adapter, and remove the need for "custom_client" and "custom_server" start methods.
Fix launcher not propagating debuggee exit code.

Fix attach-by-PID without explicit --log-dir overriding PTVSD_LOG_DIR (and disabling logging).

Improve test logging, with a separate directory for every test.

Various test fixes.
2019-09-26 13:20:26 -07:00
Pavel Minaev
eb1bb4dd5b Test fixes. 2019-09-11 20:12:12 -07:00
Pavel Minaev
981b1d1559 Fix #1648: Messaging does not allow reverse requests
Separate message parsing and message handling into separate threads.

Remove nested message handling in request handlers via `yield`, since it is incompatible with the new split model, and replace it with NO_RESPONSE and Request.respond() to defer responses until later.

Change Message.cant_handle() and Message.isnt_valid() to respond to the request and return the exception, instead of raising it, to accommodate NO_RESPONSE scenarios where a failure needs to be reported later.

Fix #1678: Do not rely on "processId" being returned by "runInTerminal" request

Extract debuggee PID from the "process" event sent by the debug server.

Fix #1679: "exited" event sometimes reports "exitCode": null

Report it as -1 if it cannot be retrieved from the debuggee process.

Fix #1680: Fatal errors in message loop do not fail fast

os._exit() immediately if a fatal error occurs in message parsing or message handling background threads.
2019-08-11 19:46:54 -07:00
Pavel Minaev
907351522d Fix race condition in test_attach. 2019-07-18 10:13:02 -07:00
Pavel Minaev
4cd1d4163f Fix #1585: Output tests fail sporadically
Wait on a breakpoint before checking output.

Add temp workaround for #1574: Flask tests fail with "no such option: --wait" on windows py27

Pin Flask version to last known good one in tests/requirements.txt.

Other fixes and improvements:

Make start_method mandatory for debug.Session to avoid problems with tests forgetting to specify it.

Add debug_me.scratchpad to enable async communication between test code and debuggee.

Improve debug.Session logging.

Improve test_attach.
2019-07-18 10:13:02 -07:00
Pavel Minaev
c03206972d Fix remaining tests to reflect the debug adapter refactoring changes.
Fix Flask and Django multiprocess tests.

Fix test logs not being captured by pytest.

Fix "import debug_me" check improperly applied in tests where it is unnecessary.

Fix some clarifying patterns not respecting the underlying pattern.

Add pattern helpers for strings: starting_with, ending_with, containing.

Move DAP test helpers to a separate module, and add a helper for frames.

Add support for line markers when setting breakpoints and matching frames.

Assorted test fixes around handling of Unicode and paths.
2019-07-11 16:19:06 -07:00
Pavel Minaev
746bda561e Test fixes. 2019-07-09 12:01:13 -07:00
Pavel Minaev
42bbc0946d Test fixes. 2019-07-08 12:03:31 -07:00
Pavel Minaev
82b62b77b5 Fix #1551: Backchannel failures in tests
Fix various bugs around handling of disconnect in JsonIOStream and JsonMessageChannel.

Fix handling of DAP "terminated" event in debug.Session.

Add --ptvsd-logs and --pydevd-logs switches to pytest.

Improve message logging to fully capture the raw message data in the logs if deserialization fails.

Log all debuggee environment variables in debug.Session, and improve log readability.
2019-07-02 17:05:51 -07:00
Karthik Nadig
1e6d2269dd
Replace wait_for_thread_stopped with wait_for_stop (#1550)
* Replace wait_for_thread_stopped with wait_for_stop

* Switch flask tests to use flask server

* Assert linter

* Use marked lines

* Fix stack logging in tests

* Prevent black from formating some debug code

* Simplify flask tests

* Replace send_request(continue) with send_continue

* fix typo
2019-07-01 14:38:07 -07:00
Karthik Nadig
8d75d6d819
Test refactoring migrated to new api (#1544)
* Update ANY to some

* Refactor breakpoint lines in tests

* Replace old import and emable debug with debug_me

* Remove unused code

* Fix some linter issues

* Change from some.such_that to some.str.such_that

* Linting with black
2019-06-28 16:27:38 -07:00
Pavel Minaev
f71f0a5b0a Tests refactoring. (#1543) 2019-06-28 10:13:00 -07:00