Skip to content

Stabilize flaky SDK multicall tests with recorded keeper fixtures FEDEV-4029#2623

Open
qwinndev wants to merge 1 commit into
releasefrom
mock-sdk-multicall-FEDEV-4029
Open

Stabilize flaky SDK multicall tests with recorded keeper fixtures FEDEV-4029#2623
qwinndev wants to merge 1 commit into
releasefrom
mock-sdk-multicall-FEDEV-4029

Conversation

@qwinndev

@qwinndev qwinndev commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

The Run SDK multicall tests CI step (cd sdk && yarn test:multicall) runs six v1 integration specs that fetched the live gmxinfra keeper (/markets, /tokens, /prices/tickers). These calls intermittently failed with FetchError: ... Premature close, reddening CI even with no code change. As a stop-gap the suites were describe.skipped.

Fix

Alias cross-fetch in sdk/vitest.multicall.config.ts to a mock (sdk/src/test/mockCrossFetch.ts) that serves recorded keeper responses from sdk/src/test/fixtures/arbitrum{Markets,Tokens,Tickers}.json for any *.gmxinfra.io / gmxinfra2.io host, and rejects unrecorded keeper paths loudly. Every other host passes through to the real fetch.

  • No production code changes — only the multicall test config + recorded fixtures.
  • viem RPC multicalls (the thing actually under test) and subsquid GraphQL stay live.
  • The six previously skipped suites are un-skipped.

Re-record fixtures when needed with e.g. curl https://arbitrum-api.gmxinfra.io/markets -o sdk/src/test/fixtures/arbitrumMarkets.json.

Verified yarn test:multicall green across 10 consecutive runs, with no live gmxinfra call.

https://linear.app/gmx-io/issue/FEDEV-4029/stabilize-flaky-sdk-multicall-tests-live-network-fetcherror-in-ci

Alias cross-fetch in the multicall vitest run to a mock that serves
recorded gmxinfra keeper responses (markets/tokens/tickers) instead of
flaky live network calls, and un-skip the six v1 integration suites.
RPC multicalls and subsquid stay live.

FEDEV-4029
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying gmx-interface-home with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2a4c50e
Status: ✅  Deploy successful!
Preview URL: https://ce918294.gmx-interface-home.pages.dev
Branch Preview URL: https://mock-sdk-multicall-fedev-402.gmx-interface-home.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying gmx-interface with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2a4c50e
Status: ✅  Deploy successful!
Preview URL: https://7e18e6e9.gmx-interface.pages.dev
Branch Preview URL: https://mock-sdk-multicall-fedev-402.gmx-interface.pages.dev

View logs

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Playwright Component Test Report

All tests passed.

View Report

Commit 2a4c50e

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant