Skip to content

Commit be5defc

Browse files
JohnMcLearclaude
andcommitted
test(ci): per-test start diag + drop stray console.log noise
Follow-up to the heartbeat PR after run 26397693748 confirmed the diagnostic works (the kill landed at importexportGetPost.ts 'Import authorization checks > authn anonymous !exist -> fail', ~300 ms after the previous test's ✔). Two cleanups so the next failure pinpoints faster and reads cleaner: 1. diagnostics.ts: emit a `test start: <name>` diag line in the mocha beforeEach hook, after setting the currentTest pointer. The 1Hz heartbeat misses tests that take less than a second, and the silent kills land ~300 ms after a test boundary — precisely the gap where heartbeat resolution fails. A start line per test gives sub-millisecond resolution on which test was on the rails when the process died. 2. specs/api/importexportGetPost.ts: drop a stray `console.log(importedPads)` debug leftover (and the duplicate `await importEtherpad(records)` only present to feed it) in the `malformed .etherpad files are rejected` block. The leftover dumped a ~600-line reflection of a supertest Response object to the CI log on every successful run, drowning the surrounding test output and making the silent-kill window much harder to read. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9b79a76 commit be5defc

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/tests/backend/diagnostics.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,17 @@ for (const sig of ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGBREAK'] as const) {
131131
// Mocha root hooks — only registered if mocha picks up this file via --require.
132132
// beforeEach sets the running pointer so a mid-test kill is attributable to a
133133
// specific test, not just the previous one that successfully finished.
134+
//
135+
// We also emit a synchronous diag line on every test start. The 1Hz heartbeat
136+
// misses tests that take less than a second, and the silent backend-test
137+
// kills land ~300 ms after a test boundary — exactly the gap where heartbeat
138+
// resolution fails us. A `start` line per test gives sub-millisecond
139+
// resolution on which test was on the rails when the process died.
134140
export const mochaHooks = {
135141
beforeEach(this: any) {
136142
if (this.currentTest) {
137143
currentTest = this.currentTest.fullTitle();
144+
diag(`test start: ${currentTest}`);
138145
}
139146
},
140147
afterEach(this: any) {

src/tests/backend/specs/api/importexportGetPost.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,6 @@ describe(__filename, function () {
418418
// that a buggy makeGoodExport() doesn't cause checks to accidentally pass.
419419
const records = makeGoodExport();
420420
await deleteTestPad();
421-
const importedPads = await importEtherpad(records)
422-
console.log(importedPads)
423421
await importEtherpad(records)
424422
.expect(200)
425423
.expect('Content-Type', /json/)

0 commit comments

Comments
 (0)