test: verify sanitizer build configuration - #1716
Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
Signed-off-by: astandrik <astandrik@yandex-team.ru>
Signed-off-by: astandrik <astandrik@yandex-team.ru>
4619986 to
ba0c499
Compare
Signed-off-by: astandrik <astandrik@yandex-team.ru>
There was a problem hiding this comment.
Pull request overview
Adds an early “compiled build configuration” probe to the C test-runner binary and enforces it from the test entrypoint scripts, preventing suites from running when a stale/misconfigured runner doesn’t match the intended sanitizer lane.
Changes:
- Add
test-runner --build-config(early-exit) that printssanitized=<0|1> test_seams=<0|1>. - In
scripts/test.sh, assert the freshly-built runner reports the expectedsanitizedvalue before running any suites (iteration / full / TSan paths). - In
scripts/msan.sh, assert the MSan runner reports the expected config before running its suites.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_main.c | Adds --build-config output based on compile-time macros (CBM_SANITIZED, CBM_ENABLE_TEST_SEAMS). |
| scripts/test.sh | Adds build-config assertion gate after building runners in each mode. |
| scripts/msan.sh | Adds the same build-config assertion gate for the MSan runner before suites. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: astandrik <astandrik@yandex-team.ru>
| #if defined(CBM_ENABLE_TEST_SEAMS) && CBM_ENABLE_TEST_SEAMS | ||
| const int test_seams = 1; | ||
| #else | ||
| const int test_seams = 0; | ||
| #endif | ||
| (void)printf("sanitized=%d test_seams=%d\n", CBM_SANITIZED, test_seams); |
What does this PR do?
Fixes #1648 by checking what each test runner was actually compiled with.
test-runner --build-configexits before suite or test-cache setup and prints one exact line:sanitized=<0|1> test_seams=<0|1>.scripts/test.shchecks that line immediately after building the runner in its iteration, full, and TSan paths.scripts/msan.shperforms the same check before its suites start. If a stale or misconfigured runner disagrees with the lane, the script now stops before any suite can run with the wrong timing budget.The patch only changes
tests/test_main.c,scripts/test.sh, andscripts/msan.sh. It does not touch the Makefile, workflows, dependencies, or production code.Checks run
sanitized=0 test_seams=1sanitized=1 test_seams=1SANITIZEpathsscripts/test.shon Linux x86-64bash -n scripts/test.sh scripts/msan.shgit diff HEAD^ HEAD --checkApple Silicon ASan and TSan fail in the sanitizer runtime before
main, so they do not provide evidence about this patch. The remote MSan path is also blocked before its build command because the Compose service is pinned tolinux/arm64and the x86-64 builder has no binfmt/QEMU registration. Windows CLANG64/CLANGARM64 and the authoritative sanitizer lanes remain for CI.Full lint reaches existing diagnostics in unchanged source files; none of the three files in this patch appears in that output.
Checklist
git commit -s): CI requires DCO.make -f Makefile.cbm test): the full Linux run passed remotely, while the Apple sanitizer runtime blocks the local default.make -f Makefile.cbm lint-ci): the current baseline reports diagnostics in unchanged source files.