Skip to content

Commit e3b951e

Browse files
committed
test(doc-links): no runner-shaped "<n> failed" text in passing output
The preview fault test printed "before=<bytes> failed=<bytes> ..." for every round, passing or not; the Windows VM leg's log guard sums every "<n> failed" it finds, read 8 such lines as 63,292,752 failed tests and failed a run whose runner had passed all 8,950. The diagnostic now prints only for a round that fails, with live_* names; the shared doc allocation line says layer_failed. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent e6638a7 commit e3b951e

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

‎tests/test_doc_mentions.c‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5237,13 +5237,19 @@ static int dm_preview_failure_checks(const char *db, const char *project) {
52375237
yyjson_doc_free(retried);
52385238
uint64_t after_retry = cbm_mem_tracked_live_bytes();
52395239
bool clean = before == after_failure && before == after_retry;
5240-
correct = consumed && error && retry && clean && correct;
5241-
fprintf(stderr,
5242-
"doc preview fault stage=%d nth=%d json=%d consumed=%d error=%d retry=%d "
5243-
"before=%llu failed=%llu retried=%llu clean=%d\n",
5244-
stage, nth ? 5 : 1, format, consumed, error, retry,
5245-
(unsigned long long)before, (unsigned long long)after_failure,
5246-
(unsigned long long)after_retry, clean);
5240+
bool round_ok = consumed && error && retry && clean;
5241+
correct = round_ok && correct;
5242+
if (!round_ok) {
5243+
/* only for a round that fails; no "<n> failed" text, which
5244+
* the VM leg's log guard counts as failed tests */
5245+
fprintf(stderr,
5246+
"doc preview fault stage=%d nth=%d json=%d consumed=%d error=%d "
5247+
"retry=%d live_before=%llu live_after_fault=%llu "
5248+
"live_after_retry=%llu\n",
5249+
stage, nth ? 5 : 1, format, consumed, error, retry,
5250+
(unsigned long long)before, (unsigned long long)after_failure,
5251+
(unsigned long long)after_retry);
5252+
}
52475253
}
52485254
}
52495255
}
@@ -6268,7 +6274,7 @@ TEST(doc_mentions_cs_shared_doc_allocation_failure) {
62686274
}
62696275
bool failed = r->doc_links.failed;
62706276
cbm_free_result(r);
6271-
printf(" shared doc allocation: stage=%d counts=%d,%d,%d failed=%d\n", cases[k].kind,
6277+
printf(" shared doc allocation: stage=%d counts=%d,%d,%d layer_failed=%d\n", cases[k].kind,
62726278
counts[0], counts[1], counts[2], failed);
62736279
bool first = fail ? counts[0] < cases[k].refs : counts[0] == cases[k].refs;
62746280
ok = ok && failed == fail && first && counts[1] == 0 && counts[2] == 0;

0 commit comments

Comments
 (0)