-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(swingset-liveslots): add retry logic to liveslots-real-gc test (#…
…11015) refs: #9392 ## Description Adding retry logic to all liveslots-real-gc tests as a temporary workaround to substantially reduce flakiness due to node GC non-determinism. ### Security Considerations N/A ### Scaling Considerations some [infrequently] failing tests will get to run twice. ### Documentation Considerations N/A ### Testing Considerations Tested manually. ### Upgrade Considerations N/A
- Loading branch information
1 parent
fe64626
commit 42dbac1
Showing
2 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Run the test and retry once if it fails. | ||
* | ||
* @param {any} test - AVA test driver function. | ||
* @param {string} title - The title of the test. | ||
* @param {import('ava').Implementation<unknown[]>} predicate - The test | ||
* implementation. | ||
*/ | ||
export const avaRetry = (test, title, predicate) => { | ||
test(title, async t => { | ||
const result = await t.try(predicate); | ||
if (result.passed) { | ||
result.commit(); | ||
} else { | ||
result.discard(); | ||
const retryResult = await t.try(predicate); | ||
retryResult.commit(); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters