From 078e289a00d657d16b7d88b202bdc78f831e4837 Mon Sep 17 00:00:00 2001 From: Kelsey Gilbert Date: Wed, 2 Oct 2024 17:47:26 -0700 Subject: [PATCH] Annotate "[buffered] " logs, and flush on finishTest, not just testFailed. (#3694) --- sdk/tests/js/js-test-pre.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/tests/js/js-test-pre.js b/sdk/tests/js/js-test-pre.js index adc1f8a5a..6ec822e8b 100644 --- a/sdk/tests/js/js-test-pre.js +++ b/sdk/tests/js/js-test-pre.js @@ -129,12 +129,14 @@ function notifyFinishedToHarness() { } } +// Start buffered, so that our thousands of passing subtests can be buffered. +// We flush the buffered logs on testFailed and/or finishTest. var _bufferedConsoleLogs = []; function _bufferedLogToConsole(msg) { if (_bufferedConsoleLogs) { - _bufferedConsoleLogs.push(msg); + _bufferedConsoleLogs.push('[buffered] ' + msg); } else if (window.console) { window.console.log(msg); } @@ -774,6 +776,7 @@ function webglHarnessCollectGarbage() { } function finishTest() { + _flushBufferedLogsToConsole(); successfullyParsed = true; var epilogue = document.createElement("script"); var basePath = "";