Skip to content

Flaky test: test_portal_api.py::test_captures_in_process_no_output_subprocess (async-tick race) #539

Description

@dotdevdotdev

tests/unit/test_portal_api.py::TestMonitorInProcessCapture::test_captures_in_process_no_output_subprocess intermittently fails in hermetic CI with:

assert {'alpha', 'beta'} <= {'alpha'}   # 'beta' missing

The monitor tick is expected to call agent.get_output for every listed session, but under CI load it sometimes captures only the first — an async-tick ordering/race, not a product bug in the code under test. Pre-existing (not introduced by #495); surfaced repeatedly while merging the #495 stack (reddened #532 once, #538 twice; cleared/bypassed via re-run or admin-merge).

Fix options: make the tick await all per-session captures deterministically before the assertion point, or make the test await tick completion (e.g. gather all get_output calls) rather than sampling mid-flight.

Found via the #495 CLI-extraction work; bypassed there with admin-merge once verified as the sole, unrelated failure (2100 passed / 1 flaky fail).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:bugNon-app work category: bugarea:tech-debtNon-app work category

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions