Skip to content

fix(ci): keep coverage profraw writable under umask 0777 tests - #13502

Merged
RenjiSann merged 3 commits into
uutils:mainfrom
l46983284-cpu:fix/uutests-llvm-profile-stderr
Jul 22, 2026
Merged

fix(ci): keep coverage profraw writable under umask 0777 tests#13502
RenjiSann merged 3 commits into
uutils:mainfrom
l46983284-cpu:fix/uutests-llvm-profile-stderr

Conversation

@l46983284-cpu

@l46983284-cpu l46983284-cpu commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Code Coverage can fail exact-stderr tests (for example mkfifo) when LLVM prints:

LLVM Profile Error: Failed to write file "...profraw": Permission denied

Root cause is not the utility under test. Some uutests set umask(0777) before spawning the binary. LLVM profile files created under that umask can be mode 000; later profile writes fail with EACCES. That message lands on the utility stderr and breaks stderr_is asserts. A shared %4m profile pool made this worse across processes.

This PR fixes the coverage harness:

  1. prepare_profraw_dir recreates the trace directory with a default owner-write ACL via setfacl (hard-fail on CI if setfacl is missing or fails).
  2. LLVM_PROFILE_FILE uses coverage-%p-%m.profraw instead of a shared %4m pool.
  3. The Ubuntu Code Coverage job installs the acl package so setfacl is present.

This replaces the earlier stderr-filter approach on this same PR. A capture-side filter can still be useful later as defense-in-depth for other LLVM I/O noise, but is not this change.

Test plan

  • Local mechanism canary: create under umask 0777 → mode 000, reopen fails; with default ACL → mode 660, reopen succeeds
  • Script path only: util/build-run-test-coverage-linux.sh + coverage job apt install
  • CI Code Coverage green on this branch
  • No change to product utilities or uutests product umask behavior

Notes

@sylvestre

Copy link
Copy Markdown
Contributor

This does not repair the underlying coverage profile-file permission failure;

did you try to fix the issue itself instead ?

Some uutests set umask(0777) before spawning the utility. LLVM profile
files created under that umask can be mode 000; later writes fail with
Permission denied on stderr and break exact asserts (e.g. mkfifo).

Prepare the profraw directory with a default owner-write ACL when
setfacl is available (hard-fail under CI), use coverage-%p-%m.profraw,
and install acl on the coverage Ubuntu job.

Signed-off-by: Alex Chen <l46983284@gmail.com>
@l46983284-cpu
l46983284-cpu force-pushed the fix/uutests-llvm-profile-stderr branch from 84e741e to 0c9625f Compare July 22, 2026 10:45
@l46983284-cpu l46983284-cpu changed the title test(uutests): ignore LLVM profile diagnostics in captured stderr fix(ci): keep coverage profraw writable under umask 0777 tests Jul 22, 2026
@l46983284-cpu

l46983284-cpu commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Yes, now — that was only a stderr filter. I replaced this PR with a coverage-script fix for the umask/profraw issue itself.

Avoid the unknown word profraw in CICD.yml and ignore setfacl/profraw
in the workflow spell-checker header.

Signed-off-by: Alex Chen <l46983284@gmail.com>
@codspeed-hq

codspeed-hq Bot commented Jul 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 339 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing l46983284-cpu:fix/uutests-llvm-profile-stderr (6c62e75) with main (decd874)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)

@sylvestre

Copy link
Copy Markdown
Contributor

much better, thanks

Default ACL still keeps umask(0777) profiles owner-writable, but restore
LLVM's online-merge pool (%4m) instead of one file per process.

Signed-off-by: Alex Chen <l46983284@gmail.com>
@RenjiSann

Copy link
Copy Markdown
Collaborator

Great ! thanks :)

@RenjiSann
RenjiSann merged commit 20bad75 into uutils:main Jul 22, 2026
163 of 164 checks passed
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.

3 participants