Repository navigation
Split the slowest Valgrind tests out of unit-large_json and unit-bjdata - #5862
Merged
Merged
Conversation
Under Valgrind, test-large_json took 570 s on 2026-09-29 but 1443 s by 2026-10-14, as the deep-value tests of #5781 and the BON8 fixes were added to it, and it now exceeds the 1500 s ctest timeout on develop. Moving the "issue #5392 - binary writers on deeply nested values" test case into unit-large_json_binary_writers.cpp halves each test (natively 4.1 s and 3.4 s instead of 7.2 s), and the two run in parallel. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
The Valgrind job still timed out after the first split: unit-bjdata took 1464 s on develop (limit 1500 s) and timed out on this PR, and unit-large_json still took 1292 s. - The BJData round-trip invariants took 80 % of unit-bjdata. They move into tests/src/bjdata_round_trip.hpp, run by unit-bjdata_round_trip_draft2.cpp and unit-bjdata_round_trip_draft3.cpp, split by the BJData version that turns a corpus value into j1. Together they run the same 36 option combinations per corpus value as before. - The "issue #5650" section (conversions between json and ordered_json) moves from unit-large_json into unit-large_json_conversions.cpp. Native -O0 times: unit-bjdata 0.9 s, the two round-trip halves 1.9 s each (was 4.5 s together); unit-large_json 1.8 s, unit-large_json_conversions 2.4 s (was 3.7 s). Assertion counts are unchanged. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
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.
The Valgrind job fails on develop (cd6b428):
test-large_json_cpp11_valgrindhits the 1500 s ctest timeout, andtest-bjdata_cpp11_valgrindis right behind it (1464 s on develop; it timed out on this PR's first CI run).This is not a performance regression. The tests simply grew: unit-large_json took 570 s under Valgrind on 633de8e (2026-09-29) and 1443 s on 4e294f4 (2026-10-14), after the deep-value tests (#5781, the BON8 writer fixes) were added to it; unit-bjdata grew with the round-trip invariants (#5569). Valgrind times also vary by about 20 % between runners, so a test near the limit fails at random.
This PR splits the slowest test cases into their own files, unchanged, so that they run in parallel:
unit-large_json.cppunit-large_json_conversions.cpp(new)unit-large_json_binary_writers.cpp(new)unit-bjdata.cppunit-bjdata_round_trip_draft2.cpp(new)unit-bjdata_round_trip_draft3.cpp(new)Before: unit-large_json 3.7 s, unit-bjdata 4.5 s. The estimates scale the native times by what CI measured for the combined tests.
The BJData round-trip check moves into
tests/src/bjdata_round_trip.hpp; each half runs the same 36 option combinations per corpus value as before, split by the version that turns a corpus value into j1. Assertion counts are unchanged (667412 for BJData in total). The new BJData targets get the same/STACKlink option on MSVC as test-bjdata. The tests themselves and the timeout are unchanged.Checked locally: all files pass; GCC 16 with the CI warning flags (C++11 and C++20), Clang 22 with
-Weverythingand the CI exclusions, and clang-tidy 22 (silkeh/clang:22, as in CI) are clean on all new and changed files.Breaking changes
No breaking changes; tests only.
🤖 Generated with Claude Code