Repository navigation
ci(test): fix the slowest-suites table on uutils sort; print CPU and SHA support - #2988
Merged
Merged
Conversation
…SHA support The "8 slowest suites" summary in scripts/run-tests-parallel.sh sorted with `sort -t= -k6 -rn`. uutils sort (Rust coreutils, shipped as sort on newer runner images) reads the attached form -t= as -t with an inline "=value", an empty separator, and exits with "separator must be exactly one character long: ''", leaving the table empty. Pass the separator as its own argument, which GNU, BSD and uutils sort all parse alike. Informational only: the script has no set -e and its exit status is unchanged. scripts/test.sh's environment line now also names the CPU and whether it has SHA-256 instructions (x86 sha_ni / ARMv8 sha2), the signal src/foundation/sha256.c uses to choose its hardware or portable backend. A sanitized runner fingerprints its own large image on that path, so which CPU a hosted job drew decides how long those fingerprints take. The helper lives in scripts/env.sh (cpu_summary, opted into via print_env --cpu, so build.sh, lint.sh and repro.sh print exactly what they did); it reads /proc/cpuinfo or lscpu on Linux/MSYS2 and sysctl on macOS, reports "unknown" for anything unreadable, and never fails the caller. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
4 tasks done
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.
Summary
Two small fixes to the test scripts' log output. Nothing here changes what runs or what gates.
"8 slowest suites" table fixed on newer runner images.
scripts/run-tests-parallel.shsorted the per-suite results withsort -t= -k6 -rn. uutils sort (Rust coreutils, which newer hostedimages ship as
sort) parses the attached form-t=as-twith aninline
=value, so the separator comes out empty. The step thenprinted
sort: separator must be exactly one character long: '', andthe table was empty on hosted x86 legs. The fix passes the separator as
its own argument (
sort -t '=' -k6,6 -rn), which GNU, BSD and uutilssort all parse the same way. The key is still field 6 of
name rc=N pass=N fail=N skip=N secs=Nsplit on=, i.e.secs.CPU model and SHA-256 instruction support in the test environment
line.
scripts/test.shnow prints, on its existing=== test.sh: os=... ===line, e.g.cpu="AMD EPYC 7763 64-Core Processor" sha_ni=yes(x86) orcpu="Apple M5 Pro" sha2=yes(ARM).src/foundation/sha256.cuses x86SHA-NI / ARMv8 SHA2 when present and its portable transform otherwise.
A sanitized test runner fingerprints its own large image on that path,
so the CPU a hosted job drew decides how long those fingerprints take.
Until now that was invisible in the log.
model nameandflags/Featuresfrom/proc/cpuinfo(whole-word match), withlscpu's "Model name" as themodel fallback (Linux arm64 has no
model nameline).sysctl machdep.cpu.brand_string, plushw.optional.arm.FEAT_SHA256(Apple silicon) or the leaf-7SHAfeature (Intel). These are the same signals
sha256.cprobes./proc/cpuinfoflags describe the emulated CPU. There the field reads
sha2=unknowninstead of guessing.
unknown.Every lookup is guarded for
set -euo pipefail, and there are noearly-exit pipes that could take SIGPIPE.
CI scope (full)
scripts/run-tests-parallel.sh: one line, the informational slowest-suites table.scripts/env.sh: newcpu_summaryhelper;print_envtakes an optional--cpu.scripts/test.sh: callsprint_env "test.sh" --cpu.scripts/test.sh. In_test.ymlthat is the test-unix, test-diag,test-lsan-macos, test-tsan and test-windows jobs; in
pr.ymlthecontracts job (
scripts/test.sh --contracts-only). The same applies tothe local venues that call
scripts/test.sh. The slowest-suites tablecomes from the parallel harness that
scripts/test.shruns.scripts/build.sh,scripts/lint.shandscripts/repro.shkeep their exact environment line (they do not pass--cpu).run-tests-parallel.shruns withoutset -e. Itsexit status still comes only from the failed-test count and the
non-zero-rc count, as before. The sort failure never failed a job; it
only lost the table.
cpu_summaryalways returns 0.Verification
against the expected top 8 by
secs:exactly the hosted error,
sort: separator must be exactly one character long: ''(exit 2). The new form ranks correctly.both forms rank correctly, so there is no change in behaviour there.
cpu="Apple M5 Pro" sha2=yes.userland):
cpu="unknown" sha2=yes. The VM's CPU part has no lscpuname; hosted arm64 runners report e.g. Neoverse.
path pointed at fixtures:
sha_ni=yes;sha_ni=no, including asha_ni_absent_decoytoken, which proves whole-word matching;MSYSTEM=CLANGARM64givessha2=unknown;cpu="unknown" sha_ni=unknown, exit 0under
set -euo pipefail.build.shandrepro.shlines are byte-identical to before.tests/test_lane_wiring_contract.sh: OK (27 lanes served).tests/test_venue_parity_contract.sh: OK (25 workflows marker-checked, 11 venue workflows whitelist-walked).scripts/test.sh --contracts-only: all 45 contract steps passed.all on untouched lines; none in
scripts/env.sh.