镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Closed

Description

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

Activity

  1. DonJayamanne commented on Mar 30, 2018

    @DonJayamanne
    Author

    Adding a few delays and delays seem to increase the success rate. But that's a work around, old PTVSD debugger didn't require any such changes.

  2. added a commit that references this issue on Jun 12, 2018
    c5db6c6
  3. locked as resolved and limited conversation to collaborators on Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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