ci: log mocha retries in spec runner (#49877)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Nilay Arya <84241885+nilayarya@users.noreply.github.com>
This commit is contained in:
trop[bot]
2026-02-19 16:22:21 -06:00
committed by GitHub
parent 0d71ed0f29
commit 4c5637c687

View File

@@ -189,6 +189,14 @@ app.whenReady().then(async () => {
chai.config.truncateThreshold = 0;
const runner = mocha.run(cb);
const RETRY_EVENT = Mocha?.Runner?.constants?.EVENT_TEST_RETRY || 'retry';
runner.on(RETRY_EVENT, (test, err) => {
console.log(`Failure in test: "${test.fullTitle()}"`);
if (err?.stack) console.log(err.stack.split('\n').slice(0, 3).join('\n'));
console.log(`Retrying test (${test.currentRetry() + 1}/${test.retries()})...`);
});
}).catch((err) => {
console.error('An error occurred while running the spec runner');
console.error(err);