Skip to content

feat: first commit flaky#61746

Draft
vespa7 wants to merge 1 commit intonodejs:mainfrom
vespa7:test-runner/feat/flaky-test-flag
Draft

feat: first commit flaky#61746
vespa7 wants to merge 1 commit intonodejs:mainfrom
vespa7:test-runner/feat/flaky-test-flag

Conversation

@vespa7
Copy link
Contributor

@vespa7 vespa7 commented Feb 8, 2026

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Feb 8, 2026
@JakobJingleheimer JakobJingleheimer self-requested a review February 9, 2026 18:15
Copy link
Member

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far. I expected to see a loop somewhere; did you merely not get to that yet (since this is a draft) or did I miss some magic somewhere?

PS Sorry this took me a while to get to.

Comment on lines 74 to +92
@@ -87,6 +87,9 @@ function formatTestReport(type, data, showErrorDetails = true, prefix = '', inde
}
} else if (expectFailure !== undefined) {
title += ` # EXPECTED FAILURE`;
} else if (flaky !== undefined && flaky > 0) {
const retryText = flaky === 1 ? 're-try' : 're-tries';
title += ` # FLAKY ${flaky} ${retryText}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same (RE var name)

let { fn, name, parent } = options;
const { concurrency, entryFile, expectFailure, loc, only, timeout, todo, skip, signal, plan } = options;

const { concurrency, entryFile, expectFailure, flaky, loc, only, timeout, todo, skip, signal, plan } = options;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is getting really long

Suggested change
const { concurrency, entryFile, expectFailure, flaky, loc, only, timeout, todo, skip, signal, plan } = options;
const {
entryFile,
expectFailure,
flaky,
loc,
only,
plan,
signal,
skip,
timeout,
todo,
concurrency,
} = options;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not be committed?

Comment on lines 68 to +84
@@ -78,6 +78,10 @@ function reportTest(nesting, testNumber, status, name, skip, todo, expectFailure
line += ` # TODO${typeof todo === 'string' && todo.length ? ` ${tapEscape(todo)}` : ''}`;
} else if (expectFailure !== undefined) {
line += ' # EXPECTED FAILURE';
//should we use flaky >=0 here? for always printing 0 retries
} else if (flaky !== undefined && flaky > 0) {
const retryText = flaky === 1 ? 're-try' : 're-tries';
line += ` # FLAKY ${flaky} ${retryText}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the feature proposal, the output cites the number of re-tries it took to succeed. So I think the name for flaky should be changed to something like flakyRetriedCount to disambiguate it with the maximum number of re-tries to attempt.

# FLAKY 42 re-tries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants