Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/profiling/collector/pprof_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def assert_stack_event(profile: pprof_pb2.Profile, sample: pprof_pb2.Sample, exp

def assert_profile_has_sample(
profile: pprof_pb2.Profile,
samples: List[pprof_pb2.Sample],
samples: Sequence[pprof_pb2.Sample],
expected_sample: StackEvent,
print_samples_on_failure: bool = False,
) -> None:
Expand Down
12 changes: 6 additions & 6 deletions tests/profiling/collector/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# https://github.com/python/cpython/issues/117983
# The fix was not backported to 3.11. The fix was first released in 3.12.5 for
# Python 3.12. Tested with Python 3.11.8 and 3.12.5 to confirm the issue.
TESTING_GEVENT = os.getenv("DD_PROFILE_TEST_GEVENT", False) and (
GEVENT_COMPATIBLE_WITH_PYTHON_VERSION = os.getenv("DD_PROFILE_TEST_GEVENT", False) and (
sys.version_info < (3, 11, 9) or sys.version_info >= (3, 12, 5)
)

Expand Down Expand Up @@ -518,11 +518,11 @@ def _fib(n: int) -> int:
return _fib(n - 1) + _fib(n - 2)


@pytest.mark.skipif(not TESTING_GEVENT, reason="Not testing gevent")
@pytest.mark.skipif(
not GEVENT_COMPATIBLE_WITH_PYTHON_VERSION, reason=f"gevent is not compatible with Python {sys.version_info}"
)
@pytest.mark.subprocess(ddtrace_run=True)
def test_collect_gevent_thread_task() -> None:
# TODO(taegyunkim): update echion to support gevent and test with stack v2

from gevent import monkey

monkey.patch_all()
Expand All @@ -545,7 +545,7 @@ def test_collect_gevent_thread_task() -> None:
ddup.start()

# Start some (green)threads
def _dofib() -> None:
def _do_fib() -> None:
for _ in range(5):
# spend some time in CPU so the profiler can catch something
# On a Mac w/ Apple M3 MAX with Python 3.11 it takes about 200ms to calculate _fib(32)
Expand All @@ -559,7 +559,7 @@ def _dofib() -> None:

with stack.StackCollector():
for i in range(5):
t = threading.Thread(target=_dofib, name="TestThread %d" % i)
t = threading.Thread(target=_do_fib, name=f"TestThread {i}")
t.start()
threads.append(t)
for t in threads:
Expand Down
Loading