@@ -47,6 +47,11 @@ def test_telemetry_enabled_on_first_tracer_flush(test_agent_session, ddtrace_run
47
47
def test_enable_fork (test_agent_session , run_python_code_in_subprocess ):
48
48
"""assert app-started/app-closing events are only sent in parent process"""
49
49
code = """
50
+ import warnings
51
+ # This test logs the following warning in py3.12:
52
+ # This process (pid=402) is multi-threaded, use of fork() may lead to deadlocks in the child
53
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
54
+
50
55
import os
51
56
52
57
from ddtrace.internal.runtime import get_runtime_id
@@ -68,7 +73,7 @@ def test_enable_fork(test_agent_session, run_python_code_in_subprocess):
68
73
69
74
stdout , stderr , status , _ = run_python_code_in_subprocess (code )
70
75
assert status == 0 , stderr
71
- assert stderr == b""
76
+ assert stderr == b"" , stderr
72
77
73
78
runtime_id = stdout .strip ().decode ("utf-8" )
74
79
@@ -86,6 +91,11 @@ def test_enable_fork(test_agent_session, run_python_code_in_subprocess):
86
91
def test_enable_fork_heartbeat (test_agent_session , run_python_code_in_subprocess ):
87
92
"""assert app-heartbeat events are only sent in parent process when no other events are queued"""
88
93
code = """
94
+ import warnings
95
+ # This test logs the following warning in py3.12:
96
+ # This process (pid=402) is multi-threaded, use of fork() may lead to deadlocks in the child
97
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
98
+
89
99
import os
90
100
91
101
from ddtrace.internal.runtime import get_runtime_id
@@ -107,7 +117,7 @@ def test_enable_fork_heartbeat(test_agent_session, run_python_code_in_subprocess
107
117
108
118
stdout , stderr , status , _ = run_python_code_in_subprocess (code )
109
119
assert status == 0 , stderr
110
- assert stderr == b""
120
+ assert stderr == b"" , stderr
111
121
112
122
runtime_id = stdout .strip ().decode ("utf-8" )
113
123
@@ -125,6 +135,11 @@ def test_heartbeat_interval_configuration(run_python_code_in_subprocess):
125
135
env = os .environ .copy ()
126
136
env ["DD_TELEMETRY_HEARTBEAT_INTERVAL" ] = "61"
127
137
code = """
138
+ import warnings
139
+ # This test logs the following warning in py3.12:
140
+ # This process (pid=402) is multi-threaded, use of fork() may lead to deadlocks in the child
141
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
142
+
128
143
from ddtrace import config
129
144
assert config._telemetry_heartbeat_interval == 61
130
145
@@ -143,6 +158,11 @@ def test_logs_after_fork(run_python_code_in_subprocess):
143
158
# Regression test: telemetry writer should not log an error when a process forks
144
159
_ , err , status , _ = run_python_code_in_subprocess (
145
160
"""
161
+ import warnings
162
+ # This test logs the following warning in py3.12:
163
+ # This process (pid=402) is multi-threaded, use of fork() may lead to deadlocks in the child
164
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
165
+
146
166
import ddtrace
147
167
import logging
148
168
import os
@@ -154,7 +174,7 @@ def test_logs_after_fork(run_python_code_in_subprocess):
154
174
)
155
175
156
176
assert status == 0 , err
157
- assert err == b""
177
+ assert err == b"" , err
158
178
159
179
160
180
def test_app_started_error_handled_exception (test_agent_session , run_python_code_in_subprocess ):
0 commit comments