Repository navigation
0.10.0: a timeout records the program's processes, asks it to end, and then ends it - #25
Merged
Merged
Conversation
…hat still runs after its grace At a program's timeout the engine records the processes of its unit (on Linux from /proc: the program, what it started and the rest of its process group, each with its state, the kernel function it sleeps in, its threads and what SIGTERM does to it; elsewhere the program alone), requests its end through openkal, waits at most its grace, records what still runs, and ends the unit. `mtest measure` passes the request on to the program it starts. `grace` and `timeout_record` are keys of [programs.*] and [discover.*] beside `timeout`; `mtest run --grace` beside `--timeout`. The record is stated in the case's reason, the terminal summary, `mtest explain`, the store and the Markdown report.
The native job restored the store the Web job had saved under their common key, which lacked the base GCC builds against; its first build installed it, the next build found the base it had recorded changed and emptied the build directory, and the conformance step found no capi or gtest fixture. The key states the job.
Sunrisepeak
added a commit
to openxlings/xim-pkgindex
that referenced
this pull request
Nov 19, 2026
…ore it is ended (#1199) On Linux the record names the program, the processes it started and its process group, with each one's state, the kernel function it waits in, its processor time and what the request to end did to it; elsewhere, the program itself. A grace period (2 s by default) separates the request from the end of the program's unit (mcpp-community/mtest#25). The bundle is mirrored at gitcode.com/xlings-res/mtest under the same sha256.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The rule "a timeout first requests the end, then terminates" for the programs the engine runs
(mcpp design record 2026-11-19, §12 and §14.2 row 4). Intermittent timeouts on mcpp's CI (a test
ended with status 137) left no state the first time they occurred.
At a program's timeout
/proc: the program,every process it started, and every other member of the process group it leads (its unit). Each
process states its parent, group, command, state, the kernel function it sleeps in (
wchan), itsprocessor time, what
SIGTERMdoes to it (ends,caught,ignored, from the masks instatus), its threads (state,wchan, processor time) and, where the system lets it be read,its kernel stack. On macOS, Windows, or where
/proccannot be read, the program alone, asmcpplibs.osdescribes it (identifier, processor time), and the record says so (seen).kal_process_terminatethroughprocess::terminate()(SIGTERMonLinux and macOS;
TerminateProcesson Windows, which openkal-windows uses for it).grace.remaining), and the unit is ended(
end_unit).mtest measure(the engine's own process that starts a program judged by its exit status, tomeasure it, natively on Linux and macOS) takes the request over and passes it on. Through 0.9.0 the
request ended
mtest measureand not the test, which the unit's end then killed without therequest.
mcpplibs.os's bounded run has no point between the request and the end, so the engine composes thesame parts (
spawn, bounded reads,wait_for,terminate,end_unit) with the record between them;the output limits and the drain are that run's (
os::process::bounds{}).Configuration
grace: a key of[programs.*]and[discover.*]besidetimeout, in the same duration words,and
mtest run --gracebeside--timeout(a catalog parameter, so the service and the MCP toolstake it too). Default 2 s:
bounds::grace, which the engine gave through 0.9.0.timeout_record: a boolean key of the same tables, defaulttrue;falsetakes no record.Neither is a case attribute: the request and the grace act on a process, not a case, and the
library's attributes are SPEC-017 P3.3 words, which a grace would extend.
Where the record appears
asked to end, it ended within its grace of 2s, orasked to end, it was still running after its grace of 2s, and was ended.mtest explain:timeoutin the JSON, and the text.timeoutobject (limit_ms,grace_ms,ended,seen,processes,remaining) inprograms.ndjsonand the failure'sprogram.json.<details>block per program below the failures.Tests (
engine/tests/engine.cpp)sleep 30under bash,--grace 60s):timeout,ended: requested; on Linux the tree holds thesleep(sleeping,request: ends), andremainingholds it, since the request did not reach it.
trap '' TERM;gracefrommtest.toml):ended: terminatedafter the timeout and the grace; on Linux its processes staterequest: ignored. OnWindows the request cannot be declined, and the test holds
requestedthere.timeout_record = falserecordsnothing.
Locally (Linux x86_64, mcpp 2026.11.18.1):
mcpp testof the library (97 cases passed, 4skipped), the manifest (14), the engine (55) and conformance (14); the conformance suite against
the Bash, Python, C ABI and GoogleTest implementations; the engine's run of mtest's own programs and
gate --set full; the working tree clean after them.CI
The first run's native job failed outside this change, twice the same way: it restored the package
store the Web job had saved first under their common key (
mcpp-store-Linux-X64-<mcpp>-<manifests>),which lacked the base GCC builds against; its first
mcpp buildinstalled it, and the nextinvocation (
mcpp test -p mcpplibs.mtest) reportedReplaced target/x86_64-linux-gnu/... (273.0 MiB): the base changedand emptied the build directory, so the conformance step found nocapi-fixture(MTEST_CTS_PROGRAMnamed the checkout's directory:permission denied). The cachekey now states the job (
github.job), so each job restores what a job of its own saved. Main's runsdid not meet it only because the native job restored before the Web job saved. That the record of
the base written during a first run's toolchain install differs from the next invocation's is
mcpp's behaviour (2026.11.14.1), reported here and not changed.
Not covered
unit that a member can observe:
kal_process_job_terminateisSIGKILLby its stated decision,and
kal_process_terminaterefuses a handle opened by identifier. A descendant receives therequest only from the program. So an e2e script (bash, then mcpp, then okrun) passes it on itself
(
trap), or openkal gains a request to a unit, for okrun's report on the request (§12) to appearunder a script.
TerminateProcess; no program observes it.mcpplibs.oslists no other process, so the record holds the programalone.
e2e::runkeepmcpplibs.os's bounded run: theyrequest the end and end the program after 2 s, and take no record.