fix(test): raise spawn-child join timeout in test_multi_process_visibility#13588
Conversation
…ility The test spawns a child via multiprocessing spawn context, which cold-imports the full langflow package (plus coverage's multiprocessing hooks in CI) before appending a single event. The 10s join timeout is routinely exceeded on a loaded CI runner sharing 4 vCPUs with a second xdist worker: in nightly run 27253229568 (Unit Tests - Python 3.12 - Group 5) the test failed all 12 executions (5 reruns x 2 step attempts), each rerun exactly 10s apart - the join deadline, not a product bug. Raise the liveness bound to 60s (join returns immediately when the child exits, so the passing case is unaffected) and kill the child on timeout so a hung spawn can't leak into later tests.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe test ChangesTest process cleanup robustness
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Test Coverage AdvisorNo source changes detected without accompanying tests. Thanks for keeping coverage up! 🎉
|
Problem
Nightly run 27253229568 failed on
Unit Tests - Python 3.12 - Group 5:test_flow_events_service.py::test_multi_process_visibilityfailed all 12 executions (5 pytest reruns × 2 step attempts) withAssertionError: Child process failed to append event.The reruns failed exactly 10s apart — the
proc.join(timeout=10)deadline, not a product bug. The test spawns a child via the multiprocessing spawn context, which cold-imports the full langflow package (plus coverage's multiprocessing hooks in CI) before appending a single event. On a loaded runner sharing 4 vCPUs with a second xdist worker that routinely exceeds 10s. This is a latent flake exposed by the test-group rebalance in #13583 (the test now runs alongside heavier neighbors).Fix
joinreturns as soon as the child exits, so the passing case is unaffectedTest plan
uv run pytest src/backend/tests/unit/test_flow_events_service.py— 16 passed in 5.3s locallySummary by CodeRabbit