Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
attach_socket_import tests hang waiting for "process" event #1552
When running multiple tests with
Estimate is uncertain, because this needs to be investigated to determine the root cause.
Only happens on Python 2.7.
I misindentified the root cause. This is actually a consistent issue in all tests that use
Thus, the test hangs, and eventually times out. But debuggee process is still out there, and it still has the debug server in it listening on a port. Thus, the next test that does any form of "attach_socket" will fail because the port it needs is hogged.
The problem itself is specific to "attach_socket_import", though - "attach_socket_cmdline" works fine by itself. The only reason why cmdline was failing is because of the port being in use.
changed the title
ptvsd port does not get properly closed when running attach_socket tests
Jul 2, 2019
As a note, on pydevd I use a new port for each new test... Seeing the way that the port is gotten on ptvsd tests (
As a reference, the way that
The port logic itself shouldn't result in any clashes, because every worker uses its own distinct port, and every worker runs tests sequentially on that port.
This bears out in practice - DebugSession can connect to ptvsd, and starts talking to it. It also starts talking to pydevd, and e.g. successfully sets protocol to JSON. It breaks down sometime after, once it gets to handling "attach".