Skip to content

Integration tests flake on container warm-up: readiness gate only checks OPTIONS #44

Description

@CaptainDriftwood

Problem

The session fixture's readiness check (tests/conftest.py, wait_for_icap_service) polls until a single OPTIONS request succeeds. c-icap answers OPTIONS while clamd is still loading its signature database, so the first real scans stall, the accept queue backs up, and concurrent tests fail on connect timeouts.

Observed: on a freshly started Docker daemon, test_concurrent_varied_sizes failed 10/10 operations with 'Connection to localhost:1344 timed out', then passed in isolation and in a full rerun once the container was warm.

The three tests currently skipped in CI are plausibly the same root cause (connections desyncing against a not-fully-ready server):

  • tests/test_connection_robustness.py:56 (test_connection_reuse_after_virus)
  • tests/test_connection_robustness.py:307 (test_alternating_clean_and_virus)
  • tests/test_benchmarks.py:169 (test_benchmark_connection_reuse)

Proposed fix

  1. Extend wait_for_icap_service to require, after OPTIONS succeeds, 1-2 consecutive successful scan_bytes calls (a clean payload and/or EICAR) with a modest latency bound, so readiness means 'ClamAV is actually scanning', not 'c-icap is accepting connections'.
  2. Re-enable the three skipif(CI) tests and observe.
  3. With flakiness fixed, enable the currently-skipped integration-tests job in the CI workflow (ubuntu runners have Docker) so the integration suite runs on PRs instead of only locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions