Repository navigation
fix(tests): make the second-interrupt test deterministic; list failures in the CI summary (ITL-1229) #432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eywalker
merged 7 commits into
main
from
eywalker/itl-1229-ci-the-python-311-full-test-job-on-main
Nov 18, 2026
Merged
fix(tests): make the second-interrupt test deterministic; list failures in the CI summary (ITL-1229) #432
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f9fa170
fix(tests): make the second-interrupt test deterministic; list failur…
d2bc556
docs(design-issues): log the over-inclusive second-interrupt warning …
2ba04d8
test(pipeline): xfail only the known second-interrupt defect, after t…
e3fd484
test(pipeline): expect only the exact known second-interrupt warning …
525d57d
test(pipeline): second press only once the caller waits again; stop t…
5862440
test(pipeline): no second press when the helper's wait times out (ITL…
8180df3
Merge remote-tracking branch 'origin/main' into eywalker/itl-1229-ci-…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ## `src/orcapod/pipeline/async_orchestrator.py` — interrupting a run inside a running loop | ||
|
|
||
| ### INT1 — the second-interrupt warning names a node whose cancelled row's function has returned | ||
| **Status:** open | ||
| **Severity:** low | ||
| **Issue:** ITL-1192 | ||
|
|
||
| A job run from inside a running event loop (a notebook cell) runs on its own thread. The first | ||
| interrupt cancels it, and the second returns control with a `RuntimeWarning` naming the nodes | ||
| whose functions have not returned (`_warn_function_still_running`). The nodes come from | ||
| `_RowsInFlight`, which counts a row from `on_data_start` until `on_data_end` or | ||
| `on_data_crash`. A row task cancelled while in progress (`process_one` in | ||
| `FunctionPod.async_execute`, awaiting `run_in_executor`) gets `CancelledError` and fires | ||
| neither. So its node stays counted whether its function was queued, still running or had | ||
| already returned on its thread, and the warning can name too many nodes ("a function in | ||
| nodes 'stuck', 'after' has not returned yet", although `after`'s function returned long | ||
| before). The class docstring admits the queued case only. | ||
|
|
||
| Effect: only the text of that warning, after a second interrupt. No crash and no wrong data: | ||
| the cancelled run writes nothing either way. The race made | ||
| `test_second_interrupt_returns_and_a_late_function_writes_nothing[delta]` flaky; it failed | ||
| half of the Python 3.11 runs on `main` (ITL-1229, which made that test deterministic). | ||
| `test_second_interrupt_does_not_name_a_node_whose_function_returned` | ||
| (`tests/test_pipeline/test_job_run_in_event_loop.py`) reproduces the defect without relying on | ||
| timing and is a strict xfail until it is fixed. | ||
|
|
||
| Proposed fix: count a row as in flight from the worker thread. Wrap the callable given to | ||
| `run_in_executor` so the count rises when the function starts on its thread and falls when it | ||
| returns or raises, whatever happens to the asyncio task. Then remove the xfail marker. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.