Skip to content

Commit c6cf4db

Browse files
test: skip flaky benchmark test in CI environment
1 parent 5601a35 commit c6cf4db

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/test_benchmarks.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
# Standard EICAR test string for triggering virus detection
2626
EICAR = b"X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
2727

28+
# TODO: Some benchmarks are flaky in CI due to the Docker-based ICAP server returning
29+
# invalid responses or unexpected redirects. The tests pass locally but fail intermittently
30+
# in GitHub Actions. Investigation needed into the CI Docker environment configuration.
31+
# See: https://github.com/CaptainDriftwood/python-icap/pull/42
32+
CI = os.environ.get("CI", "false").lower() == "true"
33+
2834

2935
# =============================================================================
3036
# Sync Client Benchmarks
@@ -160,6 +166,7 @@ def run_scan():
160166
@pytest.mark.benchmark
161167
@pytest.mark.slow
162168
@pytest.mark.docker
169+
@pytest.mark.skipif(CI, reason="Flaky in CI: receives invalid responses from Docker ICAP server")
163170
def test_benchmark_connection_reuse(benchmark, icap_service):
164171
"""Benchmark multiple scans on a single connection (amortized connection cost)."""
165172
content = b"Clean content " * 73 # ~1 KB

0 commit comments

Comments
 (0)