Skip to content

Experimental debugger fails to stop at breakpoint on CI server (multi-threaded code) #1250

@DonJayamanne

Description

@DonJayamanne

One of the unit tests (Test multi-threaded debugging) fail almost -25%-50% of the time when using the new PTVSD debugger. What's interesting is the same tests pass 100% of the time when using the old PTVSD debugger.

Here's the python code

print("step1")
import sys
import threading
import time
print("step2")

def bar():
    time.sleep(2)
    print("print")

def foo(x):
    while True:
        bar()   # add breakpoint here <-

threading.Thread(target=lambda: foo(2), name="foo").start()
foo(1)

In the unit test I add a breakpoint to the line bar() inside the loop.
I can see (after placing print statements) that two threads are running the while loop.
However, the tests fail as the debugger fails to break at the break point.

Issue filed upstream microsoft/ptvsd#282

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-debuggingbugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions