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

This commit is contained in:
Nilay Arya
2026-02-19 11:30:46 -05:00
committed by GitHub
parent 491fa0442b
commit 8b81bfda8f

View File

@@ -192,6 +192,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);