Skip to content

fix(test): stop watch and doc_read tests failing under load - #1877

Merged
igorjs merged 2 commits into
mainfrom
fix/flaky-watch-and-doc-read
Nov 19, 2026
Merged

igorjs merged 2 commits into
mainfrom
fix/flaky-watch-and-doc-read

Conversation

@igorjs

@igorjs igorjs commented Nov 19, 2026

Copy link
Copy Markdown
Member

Summary

Two groups of tests failed at random under load. Both causes are in the tests.

  • watch the_running_watch_carries_out_an_approved_item_on_its_next_cycle and siblings. The lock is an flock. When another test forks, the child holds a copy of the open lock file until it execs, so the lock stays taken after the guard was dropped. Tests now wait until it is free.
  • doc_read, including a_converter_that_uses_too_much_memory_is_stopped and section_99. The fake converter was written with fs::write and could still be open for writing when a sibling forked, so its first start failed as busy. It is now flushed, closed and run once with --version, retrying while busy. Two fixed time bounds now match what they prove.

The memory watchdog already measures the converter's own process group, so it was not the cause. The cli_smoke memory rebuild limit did not reproduce in 6 loaded runs and is unchanged.

Notes for reviewers

Full suite, --test-threads 64, 12 yes processes. The watch test failed in 4 of 12 runs before and 0 of 12 after. The doc_read suite failed in 8 of 8 runs before and 0 of 10 after. Three real_home, heal and service_manager lib tests failed in every loaded run, before and after, and pass alone. They are not touched.

A test that forks while a watch test holds the lock gives its child a copy of the open lock file until the child execs. The lock then stays taken after the test dropped it, so the next acquire saw it busy. Wait until the lock is free before a test relies on that.

Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
A fake converter written with fs::write could still be open for writing when another test forked, so under load its first start failed as busy or stalled in the system scan. Write it, flush it, and run it once with --version, retrying while busy. Bound the sigterm start wait and the too-long check by what they prove rather than short fixed numbers.

Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
@igorjs
igorjs marked this pull request as ready for review November 19, 2026 09:30
@igorjs
igorjs enabled auto-merge November 19, 2026 09:31
@igorjs
igorjs added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 6ec1891 Nov 19, 2026
40 of 46 checks passed
@igorjs
igorjs deleted the fix/flaky-watch-and-doc-read branch November 19, 2026 09:38
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