Skip to content

Commit 7fe61cb

Browse files
authored
test: retry tests that flake on transient RPC connection drops (#1249)
1 parent 3b69678 commit 7fe61cb

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

packages/indexer-common/src/allocations/__tests__/tap.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import { hexlify, verifyTypedData } from 'ethers'
2525
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2626
declare const __DATABASE__: any
2727
declare const __LOG_LEVEL__: never
28+
29+
// This suite reaches a live RPC endpoint, whose transient connection drops (socket hang
30+
// up, ECONNRESET) would otherwise fail CI, so failed tests retry up to 2 times.
31+
jest.retryTimes(2, { logErrorsBeforeRetry: true })
2832
let logger: Logger
2933
let tapCollector: TapCollector
3034
let metrics: Metrics

packages/indexer-common/src/indexer-management/__tests__/resolvers/cost-models.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import { defineQueryFeeModels } from '../../../query-fees/models'
1818
declare const __DATABASE__: any
1919
declare const __LOG_LEVEL__: never
2020

21+
// This suite reaches a live RPC endpoint, whose transient connection drops (socket hang
22+
// up, ECONNRESET) would otherwise fail CI, so failed tests retry up to 2 times.
23+
jest.retryTimes(2, { logErrorsBeforeRetry: true })
24+
2125
const SET_COST_MODEL_MUTATION = gql`
2226
mutation setCostModel($costModel: CostModelInput!) {
2327
setCostModel(costModel: $costModel) {

packages/indexer-common/src/indexer-management/__tests__/resolvers/indexing-rules.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ declare const __DATABASE__: any
2626
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2727
declare const __LOG_LEVEL__: any
2828

29+
// This suite reaches a live RPC endpoint, whose transient connection drops (socket hang
30+
// up, ECONNRESET) would otherwise fail CI, so failed tests retry up to 2 times.
31+
jest.retryTimes(2, { logErrorsBeforeRetry: true })
32+
2933
const SET_INDEXING_RULE_MUTATION = gql`
3034
mutation setIndexingRule($rule: IndexingRuleInput!) {
3135
setIndexingRule(rule: $rule) {
@@ -258,7 +262,6 @@ describe('Indexing rules', () => {
258262
protocolNetwork: 'eip155:421614',
259263
}
260264

261-
// Write the original
262265
await expect(
263266
client.mutation(SET_INDEXING_RULE_MUTATION, { rule: originalInput }).toPromise(),
264267
).resolves.toHaveProperty('data.setIndexingRule', original)
@@ -324,7 +327,6 @@ describe('Indexing rules', () => {
324327
protocolNetwork: 'eip155:421614',
325328
}
326329

327-
// Write the original
328330
await expect(
329331
client.mutation(SET_INDEXING_RULE_MUTATION, { rule: originalInput }).toPromise(),
330332
).resolves.toHaveProperty('data.setIndexingRule', original)

packages/indexer-common/src/indexer-management/__tests__/resolvers/poi-disputes.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ declare const __DATABASE__: any
2121
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2222
declare const __LOG_LEVEL__: any
2323

24+
// This suite reaches a live RPC endpoint, whose transient connection drops (socket hang
25+
// up, ECONNRESET) would otherwise fail CI, so failed tests retry up to 2 times.
26+
jest.retryTimes(2, { logErrorsBeforeRetry: true })
27+
2428
const STORE_POI_DISPUTES_MUTATION = gql`
2529
mutation storeDisputes($disputes: [POIDisputeInput!]!) {
2630
storeDisputes(disputes: $disputes) {

0 commit comments

Comments
 (0)