Skip to content

Commit 86f04db

Browse files
authored
Merge branch 'main' into dubloom/process-tags-collection
2 parents f957552 + 2cc3c8b commit 86f04db

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/internal/service_name/test_extra_services_names.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ def test_config_extra_service_names_fork(run_python_code_in_subprocess):
2020
pid = os.fork()
2121
if pid == 0:
2222
# Child process
23-
ddtrace.config._add_extra_service(f"extra_service_{i}")
24-
time.sleep(0.1) # Ensure the child has time to save the service
23+
service_name = f"extra_service_{i}"
24+
ddtrace.config._add_extra_service(service_name)
25+
# Ensure the child has time to save the service
26+
for _ in range(30):
27+
time.sleep(0.1)
28+
if service_name in set(ddtrace.config._extra_services_queue.peekall()):
29+
break
30+
else:
31+
msg = f"extra service name '{service_name}' not emitted by child"
32+
raise RuntimeError(msg)
2533
sys.exit(0)
2634
else:
2735
# Parent process

0 commit comments

Comments
 (0)