Skip to content

Commit 1771613

Browse files
committed
fix forking test
1 parent 94ab049 commit 1771613

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ddtrace/internal/telemetry/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def _fork_writer(self):
604604
atexit.unregister(self.stop)
605605
self.stop(join=False)
606606

607-
# Enable writer service in child process to avoid interpeter shutdown
607+
# Enable writer service in child process to avoid interpreter shutdown
608608
# error in Python 3.12
609609
if sys.version_info >= (3, 12):
610610
self.enable()

tests/contrib/futures/test_propagation.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,17 @@ def test_concurrent_futures_with_gevent():
359359
import os
360360
import sys
361361

362-
pid = os.fork()
362+
# Temporarily suppress warnings for Python 3.12 as os.fork() will generate a
363+
# DeprecationWarning. See https://github.com/python/cpython/pull/100229/
364+
if sys.version_info >= (3, 12):
365+
import warnings
366+
367+
with warnings.catch_warnings():
368+
warnings.simplefilter("ignore")
369+
pid = os.fork()
370+
else:
371+
pid = os.fork()
372+
363373
if pid == 0:
364374
from gevent import monkey
365375

0 commit comments

Comments
 (0)