Repository navigation
ci(tests): start every resource-monitor sample on its own line (#1888) - #1890
Merged
Merged
Conversation
- experimental.yml `Start the resource monitor`: bash line-buffers the printf builtin's output, so each sample reached the log in several writes; `tail -F` in `Run unit tests` could relay them apart and pytest's unfinished progress line land between them. The sample is now written with `cat` of a here-string, one write that opens on a newline. - test_resource_monitor_1740.py: run the sampler with a SOCK_SEQPACKET socket as its log, which keeps every write apart, put pytest's unfinished line between each two, and require every sample to start its own line, in one write no larger than PIPE_BUF. `sh()` takes `pass_fds` for the socket. Closes #1888
Owner
Author
|
Verdict: GOOD TO GO at
Unverified: GitHub-hosted runners' bash and coreutils builds. The reviewer tested bash 5.3 here. |
Contributor
|
Coverage: 90.06% (unit tier, Python 3.15,
Per-file detail: the |
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.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseRoot cause. The resource-monitor sampler in
.github/workflows/experimental.ymlwrote each sample withprintf '\n%s\n' "$(sample …)". bash line-buffers builtin output, so that printf goes out as several writes. The tests step then interleaves those writes with pytest's progress throughtail -F, so a later write of one sample could land after pytest's unfinished line. That is theuuu.u[monitor] … ps rowseen in #1881's job 117297298108.The worker counted the writes with a
SOCK_SEQPACKETsocket: a 3-line sample was 3 writes under bash 4.2 and 5.3.Fix. The step builds the sample first, then writes it with
cat <<< $'\n'"$lines", which emits it as one write that opens on a newline. The log format is unchanged, so the stop step's count still reads it.Test. The new
test_each_sample_is_one_write_so_no_output_lands_inside_itruns the real start step against aSOCK_SEQPACKETsocket and puts pytest-style output between every two writes, so it does not depend on timing. It fails with the old step and passes now. The test file passed 45 of 45 looped runs.Unverified: CI's coreutils 9
tailrelaying a single write in one piece; the host here has coreutils 8.22.Closes #1888