Skip to content

test(pipeline): make two timing tests independent of runner speed (ITL-1794) - #686

Merged
eywalker merged 1 commit into
mainfrom
eywalker/itl-1794-two-timing-dependent-tests-fail-on-a-slow
Nov 30, 2026
Merged

eywalker merged 1 commit into
mainfrom
eywalker/itl-1794-two-timing-dependent-tests-fail-on-a-slow

Conversation

@eywalker

@eywalker eywalker commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes ITL-1794

Two tests failed on Tests (3.11) during slow runs of main and passed on re-run. This PR makes each one independent of runner speed. Each still fails when the behaviour it guards breaks. Only tests change.

test_function_fan_out_completes_when_every_row_is_stored (hang guard)

  • Time limit. Each async run's limit is now 10 times the sync run of the same graph, measured in the same test on the same runner, and at least 60 s. It was a fixed 30 s. Locally a run takes about 4 s, so a slow runner has wide room. A deadlocked run never ends, so it still fails.
  • The second run tests stored rows again. Since ITL-1095 the first job holds a current run of every node, so running that job again did nothing: about 2 ms, with no row read. The guarded path (a run that finds every row stored and streams with backpressure) was not exercised any more. The second run is now a new job over the same store.

test_async_async_faster_than_async_sync_under_pool_saturation (concurrency)

The absolute wall-clock limits (< 0.20 s, >= 0.25 s) are gone. The functions now count the calls running at once:

  • Async function. Each call waits cooperatively until all 6 calls are running together. It gives up after 30 s; only lost concurrency waits that long. The test asserts that all 6 ran at once, with a pool of 2 workers.
  • Sync function. The test asserts that at most 2 calls ran at once (the pool's workers).

Evidence

Throwaway checks; none is committed:

Injected fault Result
ITL-1075 bug put back (SemiJoin collects its right input before reading its left), test 1 with the floor lowered to 10 s TimeoutError
Same bug, injected only before the run over stored rows TimeoutError on run 2
Async calls serialised (a lock around LocalPythonFunctionExecutor.async_execute_callable) fails: "at most 1 ran at once"
Async functions sent to the thread pool (run_in_executor + asyncio.run) fails: "at most 2 ran at once"
None both tests pass

Stress runs: each test run 20 times in a row with 18 CPU-bound busy loops running on an 18-core machine.

  • Python 3.12: 20/20 passed. Test 1 took about 10 s and test 2 about 0.8 s.
  • Python 3.11 (3.11.18): 20/20 passed. Test 1 took about 10 s and test 2 about 0.75 s.

No changelog fragment, because the change is test-only.

🤖 Generated with Claude Code

…est independent of runner speed (ITL-1794)

The fan-out test's time limit is now scaled from the sync run of the same graph
on the same runner (10 times it, at least 60 s), and its second run is a new job
over the same store, so it again finds every row stored (the first job holds a
current run of every node since ITL-1095, so running it again did nothing).

The pool-saturation test counts the calls running at once instead of timing the
runs: every async call runs at once, sync calls never exceed the pool's workers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pipeline tests now allow per-run timeouts for async fan-out runs and use new jobs for repeated runs against one database. The executor saturation test now checks observed call concurrency instead of elapsed-time thresholds.

Changes: Async fan-out test

Layer / File(s) Summary
Fan-out timeout and repeated runs
tests/test_pipeline/test_async_fan_out_does_not_hang.py
run_async_job accepts an optional timeout. The function-pod test sets the async timeout using the sync run duration and runs twice with new jobs that share one database. The module documentation describes the default timeout and rationale.

Executor concurrency test

Layer / File(s) Summary
Measure executor overlap
tests/test_pipeline/test_orchestrator_executor_matrix.py
The saturation test records peak concurrent calls with a lock-protected counter. It asserts that sync calls do not exceed the two-worker pool and that all six async calls overlap. The test retains result assertions and removes elapsed-time comparisons.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to 34a26

This change only makes two pipeline tests independent of runner speed. It does not alter production behavior, so merging carries no meaningful risk.

Security architecture risk: Minimal · up to 34a26

The PR changes how tests check pipeline liveness and concurrency. It does not change production behavior or expand access to any production component.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "test(pipeline): make two timing tests independent of runner speed (ITL-1794)" matches the main change. The PR changes only two timing tests in the pipeline test suite so their checks no lon…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "test(pipeline): make two timing tests independent of runner speed (ITL-1794)" matches the main change. The PR changes only two timing tests in the pipeline test suite so their checks no longer depend on runner speed. The title is short, specific, and follows conventional commit style. It names the scope (pipeline) and the purpose (runner-speed independence), and includes the ticket reference.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@eywalker
eywalker merged commit ce683c8 into main Nov 30, 2026
12 checks passed
@eywalker
eywalker deleted the eywalker/itl-1794-two-timing-dependent-tests-fail-on-a-slow branch November 30, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant