Skip to content

fix(test): raise spawn-child join timeout in test_multi_process_visibility#13588

Merged
erichare merged 1 commit into
release-1.11.0from
fix/multiprocess-test-spawn-timeout
Jun 10, 2026
Merged

fix(test): raise spawn-child join timeout in test_multi_process_visibility#13588
erichare merged 1 commit into
release-1.11.0from
fix/multiprocess-test-spawn-timeout

Conversation

@erichare

@erichare erichare commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Problem

Nightly run 27253229568 failed on Unit Tests - Python 3.12 - Group 5: test_flow_events_service.py::test_multi_process_visibility failed all 12 executions (5 pytest reruns × 2 step attempts) with AssertionError: 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

  • Raise the liveness bound to 60s — join returns as soon as the child exits, so the passing case is unaffected
  • Kill the child if it's still alive at the deadline so a hung spawn can't leak into later tests

Test plan

  • uv run pytest src/backend/tests/unit/test_flow_events_service.py — 16 passed in 5.3s locally
  • Re-run nightly failed job after merge

Summary by CodeRabbit

  • Tests
    • Improved robustness of process shutdown handling in tests with enhanced timeout management and force-termination logic.

…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.
@erichare erichare merged commit d065523 into release-1.11.0 Jun 10, 2026
12 of 14 checks passed
@erichare erichare deleted the fix/multiprocess-test-spawn-timeout branch June 10, 2026 06:13
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 69f9420d-a342-4a57-afaa-bcc01690f37b

📥 Commits

Reviewing files that changed from the base of the PR and between 1744792 and 443f1fd.

📒 Files selected for processing (1)
  • src/backend/tests/unit/test_flow_events_service.py

Walkthrough

The test test_multi_process_visibility is enhanced to handle child process shutdown more robustly. The initial join() timeout is increased to 60 seconds, and if the process has not terminated, it is force-killed via terminate() followed by an additional 5-second join to ensure cleanup.

Changes

Test process cleanup robustness

Layer / File(s) Summary
Robust child process shutdown handling
src/backend/tests/unit/test_flow_events_service.py
Extended proc.join() timeout from 10 to 60 seconds and added fallback force-kill with terminate() and additional 5-second join if the process remains alive after the initial timeout.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

ignore-for-release

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/multiprocess-test-spawn-timeout

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Advisor

No source changes detected without accompanying tests. Thanks for keeping coverage up! 🎉

Advisory check only — never blocks merge.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant