Fix arq quoting to work in runInTerminal #1981
Build #20251210.1 had test failures
Details
- Failed: 8 (0.03%)
- Passed: 19,976 (81.76%)
- Other: 4,449 (18.21%)
- Total: 24,433
Annotations
Check failure on line 5659 in Build log
azure-pipelines / debugpy-test
Build log #L5659
PowerShell exited with code '1'.
Check failure on line 2937 in Build log
azure-pipelines / debugpy-test
Build log #L2937
PowerShell exited with code '1'.
Check failure on line 3551 in Build log
azure-pipelines / debugpy-test
Build log #L3551
PowerShell exited with code '1'.
Check failure on line 1 in test_thread_count[program-launch-3]
azure-pipelines / debugpy-test
test_thread_count[program-launch-3]
assert 4 == 3
+ where 4 = len([{\n "id": 1,\n "name": "MainThread"\n}, {\n "id": 2,\n "name": "Dummy-6"\n}, {\n "id": 3,\n "name": "Thread-7 (worker)"\n}, {\n "id": 4,\n "name": "Thread-8 (worker)"\n}])
Raw output
pyfile = <function pyfile.<locals>.factory at 0x00000241F8FE98A0>
target = <class 'tests.debug.targets.Program'>, run = launch, count = 3
@pytest.mark.parametrize("count", [1, 3])
def test_thread_count(pyfile, target, run, count):
@pyfile
def code_to_debug():
import debuggee
import threading
import time
import sys
debuggee.setup()
stop = False # noqa: F841
def worker(tid, offset):
i = 0
global stop
while not stop:
time.sleep(0.01)
i += 1
threads = []
if sys.argv[1] != "1":
for i in [111, 222]:
thread = threading.Thread(target=worker, args=(i, len(threads)))
threads.append(thread)
thread.start()
print("check here") # @bp
stop = True # noqa: F841
with debug.Session() as session:
with run(session, target(code_to_debug, args=[str(count)])):
session.set_breakpoints(code_to_debug, all)
session.wait_for_stop()
threads = session.request("threads")
> assert len(threads["threads"]) == count
E assert 4 == 3
E + where 4 = len([{\n "id": 1,\n "name": "MainThread"\n}, {\n "id": 2,\n "name": "Dummy-6"\n}, {\n "id": 3,\n "name": "Thread-7 (worker)"\n}, {\n "id": 4,\n "name": "Thread-8 (worker)"\n}])
tests\debugpy\test_threads.py:46: AssertionError
Check failure on line 1 in test_step_multi_threads[program-launch-default]
azure-pipelines / debugpy-test
test_step_multi_threads[program-launch-default]
assert 4 == 3
+ where 4 = len([{\n "id": 1,\n "name": "MainThread"\n}, {\n "id": 2,\n "name": "Dummy-6"\n}, {\n "id": 3,\n "name": "thread1"\n}, {\n "id": 4,\n "name": "thread2"\n}])
Raw output
pyfile = <function pyfile.<locals>.factory at 0x00000241F8FEBA60>
target = <class 'tests.debug.targets.Program'>, run = launch, resume = 'default'
@pytest.mark.parametrize("resume", ["default", "resume_all", "resume_one"])
def test_step_multi_threads(pyfile, target, run, resume):
@pyfile
def code_to_debug():
# After breaking on the thread 1, thread 2 should pause waiting for the event1 to be set,
# so, when we step return on thread 1, the program should finish if all threads are resumed
# or should keep waiting for the thread 2 to run if only thread 1 is resumed.
import debuggee
import threading
debuggee.setup()
event0 = threading.Event()
event1 = threading.Event()
event2 = threading.Event()
event3 = threading.Event()
def _thread1():
while not event0.is_set():
event0.wait(timeout=0.001)
event1.set() # @break_thread_1
while not event2.is_set():
event2.wait(timeout=0.001)
# Note: we can only get here if thread 2 is also released.
event3.set()
def _thread2():
event0.set()
while not event1.is_set():
event1.wait(timeout=0.001)
event2.set()
while not event3.is_set():
event3.wait(timeout=0.001)
threads = [
threading.Thread(target=_thread1, name="thread1"),
threading.Thread(target=_thread2, name="thread2"),
]
for t in threads:
t.start()
for t in threads:
t.join()
with debug.Session() as session:
if resume == "resume_all":
session.config["steppingResumesAllThreads"] = True
elif resume == "resume_one":
session.config["steppingResumesAllThreads"] = False
with run(session, target(code_to_debug)):
session.set_breakpoints(code_to_debug, all)
stop = session.wait_for_stop()
threads = session.request("threads")
> assert len(threads["threads"]) == 3
E assert 4 == 3
E + where 4 = len([{\n "id": 1,\n "name": "MainThread"\n}, {\n "id": 2,\n "name": "Dummy-6"\n}, {\n "id": 3,\n "name": "thread1"\n}, {\n "id": 4,\n "name": "thread2"\n}])
tests\debugpy\test_threads.py:105: AssertionError
Check failure on line 1 in test_invalid_breakpoints[program-attach_connect(cli)]
azure-pipelines / debugpy-test
test_invalid_breakpoints[program-attach_connect(cli)]
failed on teardown with "KeyError: <_pytest.stash.StashKey object at 0x000001C1E29D2E40>"
Raw output
cls = <class '_pytest.runner.CallInfo'>
func = <function call_and_report.<locals>.<lambda> at 0x000001C1E4BA76A0>
when = 'teardown'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
@classmethod
def from_call(
cls,
func: Callable[[], TResult],
when: Literal["collect", "setup", "call", "teardown"],
reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
) -> CallInfo[TResult]:
"""Call func, wrapping the result in a CallInfo.
:param func:
The function to call. Called without arguments.
:type func: Callable[[], _pytest.runner.TResult]
:param when:
The phase in which the function is called.
:param reraise:
Exception or exceptions that shall propagate if raised by the
function, instead of being wrapped in the CallInfo.
"""
excinfo = None
instant = timing.Instant()
try:
> result: TResult | None = func()
^^^^^^
.tox\py312\Lib\site-packages\_pytest\runner.py:353:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\py312\Lib\site-packages\_pytest\runner.py:245: in <lambda>
lambda: runtest_hook(item=item, **kwds),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox\py312\Lib\site-packages\pluggy\_hooks.py:512: in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox\py312\Lib\site-packages\pluggy\_manager.py:120: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox\py312\Lib\site-packages\_pytest\logging.py:858: in pytest_runtest_teardown
yield
.tox\py312\Lib\site-packages\_pytest\capture.py:905: in pytest_runtest_teardown
return (yield)
^^^^^
.tox\py312\Lib\site-packages\_pytest\runner.py:194: in pytest_runtest_teardown
item.session._setupstate.teardown_exact(nextitem)
.tox\py312\Lib\site-packages\_pytest\runner.py:566: in teardown_exact
raise exceptions[0]
.tox\py312\Lib\site-packages\_pytest\runner.py:555: in teardown_exact
fin()
.tox\py312\Lib\site-packages\_pytest\fixtures.py:1053: in finish
raise exceptions[0]
.tox\py312\Lib\site-packages\_pytest\fixtures.py:1042: in finish
fin()
.tox\py312\Lib\site-packages\_pytest\fixtures.py:924: in _teardown_yield_fixture
next(it)
.tox\py312\Lib\site-packages\_pytest\tmpdir.py:272: in tmp_path
result_dict = request.node.stash[tmppath_result_key]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.stash.Stash object at 0x000001C1E4822B60>
key = <_pytest.stash.StashKey object at 0x000001C1E29D2E40>
def __getitem__(self, key: StashKey[T]) -> T:
"""Get the value for key.
Raises ``KeyError`` if the key wasn't set before.
"""
> return cast(T, self._storage[key])
^^^^^^^^^^^^^^^^^^
E KeyError: <_pytest.stash.StashKey object at 0x000001C1E29D2E40>
.tox\py312\Lib\site-packages\_pytest\stash.py:84: KeyError
Check failure on line 1 in test_thread_count[program-launch-3]
azure-pipelines / debugpy-test
test_thread_count[program-launch-3]
assert 4 == 3
+ where 4 = len([{\n "id": 1,\n "name": "MainThread"\n}, {\n "id": 2,\n "name": "Dummy-6"\n}, {\n "id": 3,\n "name": "Thread-7 (worker)"\n}, {\n "id": 4,\n "name": "Thread-8 (worker)"\n}])
Raw output
pyfile = <function pyfile.<locals>.factory at 0x000001DC26D6E830>
target = <class 'tests.debug.targets.Program'>, run = launch, count = 3
@pytest.mark.parametrize("count", [1, 3])
def test_thread_count(pyfile, target, run, count):
@pyfile
def code_to_debug():
import debuggee
import threading
import time
import sys
debuggee.setup()
stop = False # noqa: F841
def worker(tid, offset):
i = 0
global stop
while not stop:
time.sleep(0.01)
i += 1
threads = []
if sys.argv[1] != "1":
for i in [111, 222]:
thread = threading.Thread(target=worker, args=(i, len(threads)))
threads.append(thread)
thread.start()
print("check here") # @bp
stop = True # noqa: F841
with debug.Session() as session:
with run(session, target(code_to_debug, args=[str(count)])):
session.set_breakpoints(code_to_debug, all)
session.wait_for_stop()
threads = session.request("threads")
> assert len(threads["threads"]) == count
E assert 4 == 3
E + where 4 = len([{\n "id": 1,\n "name": "MainThread"\n}, {\n "id": 2,\n "name": "Dummy-6"\n}, {\n "id": 3,\n "name": "Thread-7 (worker)"\n}, {\n "id": 4,\n "name": "Thread-8 (worker)"\n}])
tests\debugpy\test_threads.py:46: AssertionError