Skip to content

Commit 179f265

Browse files
committed
ci: fix flaky test_partial_flush_log stdout
1 parent be7f4cb commit 179f265

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

tests/integration/utils.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,29 @@ def send_invalid_payload_and_get_logs(encoder_cls=BadEncoder):
3636
return log
3737

3838

39-
def parametrize_with_all_encodings(env=None, out="", err="", check_logs=True):
39+
def parametrize_with_all_encodings(env=None, out=None, err="", check_logs=True):
4040
if env is None:
4141
env = dict()
42+
43+
def stdout_ok(stream):
44+
# Ensure no unexpected output in stdout
45+
#
46+
# b"Got response: 200 OK sent 711B in 1.59383s to http://localhost:9126/v0.4/traces"
47+
# may appear in some cases and is acceptable
48+
#
49+
# Empty lines are also ignored
50+
lines = [l.strip() for l in stream.splitlines() if l.strip() and b"Got response: 200 OK sent" not in l]
51+
assert not lines, f"Unexpected output in stdout: {lines}"
52+
53+
if out is None:
54+
out = stdout_ok
55+
4256
return pytest.mark.subprocess(
43-
parametrize={"DD_TRACE_API_VERSION": ["v0.5", "v0.4"]}, env=env, out=out, err=err, check_logs=check_logs
57+
parametrize={"DD_TRACE_API_VERSION": ["v0.5", "v0.4"]},
58+
env=env,
59+
out=out,
60+
err=err,
61+
check_logs=check_logs,
4462
)
4563

4664

tests/suitespec.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ suites:
178178
pattern: integration-latest*
179179
runner: riot
180180
integration_testagent:
181+
retry: 1
181182
parallelism: 3
182183
paths:
183184
- '@tracing'

0 commit comments

Comments
 (0)