-
-
Notifications
You must be signed in to change notification settings - Fork 34.9k
feat: first commit flaky #61746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: first commit flaky #61746
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ function formatError(error, indent) { | |
| function formatTestReport(type, data, showErrorDetails = true, prefix = '', indent = '') { | ||
| let color = reporterColorMap[type] ?? colors.white; | ||
| let symbol = reporterUnicodeSymbolMap[type] ?? ' '; | ||
| const { skip, todo, expectFailure } = data; | ||
| const { skip, todo, expectFailure, flaky } = data; | ||
| const duration_ms = data.details?.duration_ms ? ` ${colors.gray}(${data.details.duration_ms}ms)${colors.white}` : ''; | ||
| let title = `${data.name}${duration_ms}`; | ||
|
|
||
|
|
@@ -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}`; | ||
|
Comment on lines
74
to
+92
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same (RE var name) |
||
| } | ||
|
|
||
| const err = showErrorDetails && data.details?.error ? formatError(data.details.error, indent) : ''; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -85,6 +85,7 @@ const kTestTimeoutFailure = 'testTimeoutFailure'; | |||||||||||||||||||||||||||||
| const kExpectedFailure = 'expectedFailure'; | ||||||||||||||||||||||||||||||
| const kHookFailure = 'hookFailed'; | ||||||||||||||||||||||||||||||
| const kDefaultTimeout = null; | ||||||||||||||||||||||||||||||
| const kDefaultFlakyRetries = 20; | ||||||||||||||||||||||||||||||
| const noop = FunctionPrototype; | ||||||||||||||||||||||||||||||
| const kShouldAbort = Symbol('kShouldAbort'); | ||||||||||||||||||||||||||||||
| const kHookNames = ObjectSeal(['before', 'after', 'beforeEach', 'afterEach']); | ||||||||||||||||||||||||||||||
|
|
@@ -497,7 +498,8 @@ class Test extends AsyncResource { | |||||||||||||||||||||||||||||
| super('Test'); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| 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; | ||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this is getting really long
Suggested change
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| if (typeof fn !== 'function') { | ||||||||||||||||||||||||||||||
| fn = noop; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should not be committed? |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
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
flakyshould be changed to something likeflakyRetriedCountto disambiguate it with the maximum number of re-tries to attempt.