Skip to content

test(standard): give a stopped memory run a load-tolerant time to clean up - #142

Merged
harenome merged 1 commit into
ThinkFlowLab:mainfrom
harenome:fix/sigterm-test-wait
Nov 16, 2026
Merged

harenome merged 1 commit into
ThinkFlowLab:mainfrom
harenome:fix/sigterm-test-wait

Conversation

@harenome

Copy link
Copy Markdown
Collaborator

Closes #112

What

test_sigterm_stops_a_real_memory_process_and_writes_cancelled_results sends SIGTERM to a standard run, then waits for the run to exit with communicate. The upper limit of this wait is now 60 s, where it was 12 s. 60 s is the limit that the same test gives the memory process to start.

communicate returns when the run exits. Thus the wait already stops on a condition, and a passing run takes the same time as before. Only the limit changes. A wait on the cancelled results would add a poll loop and would not make the test shorter: the test must wait for the exit to check the exit code and the memory process.

After SIGTERM, the run gives the memory process 3 s to exit, then kills its group. Then the run writes the cancelled results and exits. On a loaded machine, this can take more than 12 s. The exit code, cancelled-result and parse checks do not change.

Touches

backend · the standard (tests only)

  • app/tests/test_audit_regressions.py

Verified

Measured on e7c3e85. Rebased onto 4648c75, which changes nothing this test runs.

The backend suite, python3 app/tests/parallel.py, in rootless Podman containers (python:3.12, --init --cpus 1), 12 runs on each side:

TimeoutExpired after SIGTERM memory did not start Pass
main 3 2 7
this branch 0 2 10

The main failures are subprocess.TimeoutExpired: ... timed out after 12 seconds, at communicate(timeout=12). The memory did not start failures are the 60 s wait before SIGTERM, which this change does not touch. They occurred only in the 6 runs on each side made while the host itself was overloaded.

Other tests also fail at 1 CPU, on main and on this branch: on their own fixed waits, or because the image has no uv. This change does not touch them.

The test still fails when the run does not stop correctly. Each check used a local change that is not in this branch:

  • The run ignores SIGTERM (signal.SIG_IGN in place of cli._exit_on_term()): TimeoutExpired after 60 s.
  • The run does not kill the memory process (os.killpg removed from jsonl.Proc.close): TimeoutExpired after 60 s.
  • The run has no SIGTERM handler, so it writes no cancelled results: AssertionError: -15 != 143.

Without a CPU limit, at this branch: backend suite 1991 tests in 116 modules: OK, route suite 328 tests in 41 modules: OK.

Risk

Low. The change is in test code only. Undo it with a revert.

  • When the run does not stop, the test now fails after 60 s, where it failed after 12 s.
  • A machine that needs more than 60 s to stop the run still fails this test.

…an up

After SIGTERM, the run closes the memory process (3 s for it to exit,
then SIGKILL), writes the cancelled results and exits. The test gave
this 12 s, which a loaded runner exceeds. Give it 60 s, the same time
the test gives the memory process to start.
@harenome
harenome merged commit c9e0094 into ThinkFlowLab:main Nov 16, 2026
2 checks passed
@harenome
harenome deleted the fix/sigterm-test-wait branch November 16, 2026 12:13
aitianshi added a commit that referenced this pull request Nov 23, 2026
No linked issue: the owner asked for a new release, v0.2.0.

## What

Prepares v0.2.0. The version becomes `0.2.0`, a minor bump for the scale
of change since v0.1.1: model providers defined once (#148), saved
recipes moved to the user data directory (#203), the standard package
reorganised (#290, #316), new benchmarks and Boat VMs.
`docs/releases/v0.2.0.md` gives the highlights, a Contributors section,
the full changelog of the 97 pull requests in `v0.1.1..main` (93 listed,
#142, #219, #234 and #320 as test and CI changes) and the installation
notes, in the shape of v0.1.1's. Install examples, the release guide,
the docs' release-notes link and menu, and the workflows' default tags
name 0.2.0. The release tooling does not change.

## Touches

CI and skills (the release and publish workflows' default tags) · docs
and site

## Verified

- Backend suite: 2799 tests in 171 modules, OK. Route suite: 624 tests
in 64 modules, OK.
- `catalogue_docs.py --write` and `diagrams.py --write` left no change;
`readme_media.py --check` is current.
- `python3 app/packaging/release.py build --tag v0.2.0` built and
verified `nullius_eval-0.2.0-py3-none-any.whl`,
`nullius_eval-0.2.0.tar.gz` and `SHA256SUMS`; `release.py verify --tag
v0.2.0` and `verify.py` on the wheel passed, including the
installed-tool and profile-preservation checks.
- The workflows have not run; they run only by hand on `main`.

## Risk

Version strings and docs only. A wrong default tag in a workflow is an
input the person running it can change, and `release.py` refuses a tag
that does not match `pyproject.toml` or has no notes. Nothing is tagged,
drafted or published by this change. Undo with a revert.
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.

Tests: the SIGTERM test of a memory run gives its cleanup a fixed 12 s

1 participant