| [gw0] darwin -- Python 3.13.15 /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
|
|
|
| py = '3.14t'
|
|
|
| @requires_sudo
|
| @allpythons()
|
| def test_where_asyncio_fan_in(py):
|
| """Two independent tasks directly awaiting the same third task at once
|
| forces CPython to represent that task's task_awaited_by as a SET rather than
|
| a single reference -- the only way to exercise Austin's waiter-set walk, as
|
| opposed to the single-waiter fast path every other asyncio test target
|
| exercises. Rendered as a tree, a task with two waiters necessarily shows up
|
| twice (once nested under each waiter, since a fan-in can't be flattened into
|
| a single-parent tree) -- that duplication is the signal that both waiter
|
| edges from the set were actually walked and emitted."""
|
| with run_python(py, target("target_asyncio_fanin.py")) as p:
|
| expected = ("shared_worker", "fan-in-0", "fan-in-1")
|
| > result = retry_where(
|
| p.pid,
|
| lambda out: (
|
| all(s in out for s in expected) and out.count("shared_worker") >= 2
|
| ),
|
| )
|
|
|
| test/functional/test_asyncio.py:138:
|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
| test/utils.py:471: in retry_where
|
| return austin("-w", str(pid))
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
| test/utils.py:337: in __call__
|
| return self.prepare_result(result, expect_fail, convert)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
| self = Variant('austin')
|
| result = CompletedProcess(args=['src/austin', '-w', '3657'], returncode=1, stdout='', stderr="\x1b[1m _ _ \...ach to the given process. Make sure that the PID you have provided\nis valid and that the process is still running.\n")
|
| expect_fail = False, convert = True
|
|
|
| def prepare_result(self, result, expect_fail, convert):
|
| if result.returncode in (-11, 139): # SIGSEGV
|
| print(bt(self.path, result.pid))
|
|
|
| # If we are writing to stdout, check if we need to convert the stream
|
| if result.stdout.startswith(b"MOJ"):
|
| if convert:
|
| try:
|
| result.samples, result.metadata = parse_mojo(result.stdout)
|
| except Exception as e:
|
| dump_mojo(result.stdout)
|
| raise e
|
| else:
|
| result.stdout = result.stdout.decode()
|
| result.stderr = result.stderr.decode()
|
|
|
| logs = collect_logs(self.name, result.pid)
|
| result.logs = logs
|
|
|
| if isinstance(expect_fail, bool) and expect_fail is bool(result.returncode):
|
| return result
|
|
|
| if isinstance(expect_fail, int) and result.returncode == expect_fail:
|
| return result
|
|
|
| print_logs(logs)
|
| > raise RuntimeError(
|
| f"Command {self.name} returned {result.returncode} "
|
| f"while expecting {expect_fail}. Output:\n{result.stdout}\n"
|
| f"Error:\n{result.stderr}"
|
| )
|
| E RuntimeError: Command austin returned 1 while expecting False. Output:
|
| E
|
| E Error:
|
| E [1m _ _ [0m
|
| E [1m __ _ _ _ __| |_(_)_ _ [0m
|
| E [1m/ _` | || (_-< _| | ' \ [0m
|
| E [1m\__,_|\_,_/__/\__|_|_||_| [0m [1;36m4.1.0 [0m [gcc 15.3.0]
|
| E
|
| E 🛑 Cannot attach to the given process. Make sure that the PID you have provided
|
| E is valid and that the process is still running.
|
|
|
| test/utils.py:365: RuntimeError
|