From 10ef088fbc135ceb6a080998a53bf2de61d7a278 Mon Sep 17 00:00:00 2001 From: Brandon Cheng Date: Sat, 2 Sep 2023 12:05:25 -0400 Subject: [PATCH] test: set logErrorsBeforeRetry to debug failing retries (#7028) --- jest.setup.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jest.setup.js b/jest.setup.js index 9dd25c3632..7c1da29409 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -1,4 +1,11 @@ -jest.retryTimes(1); +jest.retryTimes(1, { + // Some tests don't clean up their resources completely and cause the retried + // run fail. Set logErrorsBeforeRetry to make it more clear that the retried + // run was a retry and not the first attempt. Otherwise Jest hides the first + // attempt. This makes it easier to distinguish between a test that's truly + // broken and one that's not retry-able. + logErrorsBeforeRetry: true +}) afterAll(() => { // @ts-expect-error