Skip to content

Fix/postman row truncation#9

Merged
vjan-nie merged 3 commits into
Univers42:mainfrom
vjan-nie:fix/postman-row-truncation
Jul 13, 2026
Merged

Fix/postman row truncation#9
vjan-nie merged 3 commits into
Univers42:mainfrom
vjan-nie:fix/postman-row-truncation

Conversation

@vjan-nie

Copy link
Copy Markdown
Collaborator

Summary

PostMan's report could print "All 256 assertions passed" while hundreds of
results — including genuine failures — had been discarded without a word.

PM_MAX_ROWS = 256 sized a fixed array, and record() returned early past it
(PostMan.cpp:154). Under --gtest_repeat=3 over the full suite, 444 tests
ran and passed, but the table reported 256. The exit code was never wrong (it
comes from RUN_ALL_TESTS()), so CI was honest — the report a human reads
was not
.

The dangerous case is worse than an undercount: a test that FAILS past row 256
has its row dropped before passed is even inspected. Verified: green table,
make exiting with Error 1. Table and process fully desynchronised.

This matters because --gtest_repeat is this repo's main tool for ruling out
flakiness. T6 was validated with it. A reporter that quietly hides rows poisons
the instrument.

Fix

PmRow[PM_MAX_ROWS]std::vector<PmRow>, no capacity guard. print()
derives every count from _rows.size(). The macro is removed, not raised:
bumping 256 to 4096 would have made the test green and left the silent-drop
behaviour intact one order of magnitude further out.

~50 net lines across vendor/PostMan.{hpp,cpp}, plus a regression test and one
line in tests/Makefile.

Verification

  • Regression test fails against the pre-fix code (confirmed by reverting the
    fix, not by reading the diff): reported delta 108 vs 300 expected.
  • --gtest_repeat=3 now reports 1347 = 3 × 449, exact, no clamping.
  • A real EXPECT_TRUE(false) past row 256 now shows as FAIL in the table and
    in the aggregate.
  • scripts/audit.sh PASSED on all three tiers; suite green.

Accepted risk

The vector has no ceiling. A future bug calling record() in a runaway loop
grows memory unbounded instead of clamping at ~20 KB. Deliberate — clamping is
what caused this bug.

Out of scope

Dockerfile:10 and ci.yml:53 still say "138-assertion suite". Stale, but a
separate ticket.

vjan-nie added 3 commits July 13, 2026 10:07
… cap

TestReport::record() silently drops rows once PM_MAX_ROWS (256) is
reached, corrupting PostMan's summary table and verdict with no
warning. This test records 300 synthetic rows directly and asserts the
observed row count matches — it fails today (clamped at 256) and is
expected to pass once the fixed-size PmRow array becomes a std::vector.

Adds TestReport::rowCount() as a minimal test-visible accessor; no
other behavior changes.
record() silently dropped rows once the 256-entry PmRow[] backing
array filled up, so PostMan's summary table and verdict went blind
past that point without any warning (reproducible with
--gtest_repeat). print()/calcCols() were already parameterized by the
real row count, not the array capacity, so switching _rows to a
std::vector removes the cap without touching any rendering code.

PostMan.cpp compiles under C++17 (tests/Makefile), so std::vector is
unrestricted here. rowCount() now reports the vector's real size.
Records more than PM_MAX_ROWS synthetic rows and asserts the reported
row count matches what was recorded. Fails against the current fixed
array: record() returns early past 256 with no warning, so the delta
comes back at 108 instead of 300.
@vjan-nie
vjan-nie merged commit f4f6267 into Univers42:main Jul 13, 2026
2 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.

1 participant