test: IO gates of slice G (eight files at once, a cancelled wait per mechanism) #162
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/5-io-gates-slice-g"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #5
What
tests/conformance/io-eight-files.trb: eightFile.readtasks of files of very different sizes are started before any is awaited and printed in file order, in the VM and natively, with all workers and the zero-live-blocks leak gate.runtime/tests/io_test.c: a cancelled wait is tested on each mechanism. The poller (epoll, kqueue) and the completion port (IOCP) intest_io_a_cancelled_wait_releases_its_registration; the blocking pool intest_io_a_cancelled_wait_on_the_blocking_pool_stops_when_the_thread_returns(all platforms) andtest_io_a_cancelled_file_read_stops_when_the_thread_returns(POSIX, a read waiting on a named pipe). The harness's live-block check proves the frame is released.Defect found
The pool tests showed that a stream task cancelled while its call ran finished with the call's answer, where section 7 of CONCURRENCY.md says it stops with the answer discarded.
runtime/stream.cnow stops it (own commitfix(runtime)); bytes a read got stay in the stream's buffer for the next reader. A task cancelled this way is observed as cancelled, never as a value.Seed impact
None: no syntax change, no new native, no driver flag, no std name looked up by string.
Test
Locally: the conformance program runs in the VM with the expected output,
torb format --checkclean,tools/check-commits.sh origin/main HEADclean. Gates (tools/gates.sh aandb) run in the forge CI of this PR; the result is recorded below.99e66f0911a2ce41fa96CI on
a2ce41fa: green (tier A, tier B linux-x64, gates, bootstrap, pdisc, commit messages). The forge CI has no macOS or Windows runner, so the IOCP and kqueue paths of the new tests run in the mirror workflow only.Approved.
torb_task_cancelledcheck intorb_stream_resumemirrors the two existing stop paths (frame freed,TORB_POLL_STOPPED, result slot untouched); matches CONCURRENCY.md section 7. Bytes a read got stay in the stream buffer, as the FIFO test shows.Non-blocking: