Skip to content

Commit 20aa9bd

Browse files
authored
Fix flicky test (#3520)
1 parent 4c776b4 commit 20aa9bd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/soak-test-start.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
run-soak-tests:
1313
name: Run Soak Tests Against Changed Adapters
14-
runs-on: ubuntu-latest-8cores-32GB
14+
runs-on: ubuntu-latest-16cores-64GB
1515
environment: QA
1616
permissions:
1717
id-token: write

packages/sources/elwood/test/integration/adapter.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ describe('websocket', () => {
4444
process.env['METRICS_ENABLED'] = 'false'
4545
// Start mock web socket server
4646
mockWebSocketProvider(WebSocketClassProvider)
47-
mockWebSocketServer(`wss://api.chk.elwood.systems/v1/stream?apiKey${process.env['API_KEY']}`)
47+
mockWsServer = mockWebSocketServer(
48+
`wss://api.chk.elwood.systems/v1/stream?apiKey${process.env['API_KEY']}`,
49+
)
50+
51+
mockSubscriptionsResponse(apiKey, [])
52+
mockSubscribeResponse(apiKey, `${data.base}-${data.quote}`)
4853

4954
const adapter = (await import('./../../src')).adapter
5055
testAdapter = await TestAdapter.startWithMockedCache(adapter, {
@@ -63,11 +68,9 @@ describe('websocket', () => {
6368

6469
describe('price endpoint', () => {
6570
it('should return success', async () => {
66-
mockSubscriptionsResponse(apiKey, [])
67-
const scope = mockSubscribeResponse(apiKey, `${data.base}-${data.quote}`)
6871
const response = await testAdapter.request(data)
72+
6973
expect(response.json()).toMatchSnapshot()
70-
expect(scope.isDone()).toEqual(true)
7174
})
7275

7376
it('should skip subscribing if already subscribed', async () => {
@@ -80,14 +83,12 @@ describe('websocket', () => {
8083
})
8184

8285
it('should return success (LWBA)', async () => {
83-
mockSubscriptionsResponse(apiKey, [])
8486
mockSubscribeResponse(apiKey, `${dataLWBA.base}-${dataLWBA.quote}`)
8587
const response = await testAdapter.request(dataLWBA)
8688
expect(response.json()).toMatchSnapshot()
8789
})
8890

8991
it('should return error (LWBA invariant violation)', async () => {
90-
mockSubscriptionsResponse(apiKey, [])
9192
mockSubscribeResponse(
9293
apiKey,
9394
`${dataLWBAInvariantViolation.base}-${dataLWBAInvariantViolation.quote}`,
@@ -101,7 +102,6 @@ describe('websocket', () => {
101102
base: 'XXX',
102103
quote: 'USD',
103104
}
104-
mockSubscriptionsResponse(apiKey, [])
105105
mockSubscribeError(apiKey, `${data.base}-${data.quote}`)
106106
await testAdapter.request(data)
107107
await testAdapter.waitForCache()

0 commit comments

Comments
 (0)