Skip to content

Commit a57b34e

Browse files
authored
test: resolve flaky telemetry and build info tests (#6546)
* test: update timeout in telemetry test * test: consistent return order in build info settings
1 parent e7df8ca commit a57b34e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/build-info/src/node/get-build-info.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ test.skipIf(platform() === 'win32')(
7979
const info = await getBuildInfo({ rootDir: fixture.cwd, projectDir: fixture.cwd })
8080

8181
info.jsWorkspaces!.rootDir = '/cleaned-for-snapshot'
82+
info.settings = info.settings.sort((a, b) => (a.dist < b.dist ? -1 : 1))
8283
expect(info).toMatchSnapshot()
8384
},
8485
)
@@ -90,6 +91,7 @@ test.skipIf(platform() === 'win32')(
9091
const info = await getBuildInfo({ rootDir: fixture.cwd, projectDir: join(fixture.cwd, 'packages/blog') })
9192

9293
info.jsWorkspaces!.rootDir = '/cleaned-for-snapshot'
94+
info.settings = info.settings.sort((a, b) => (a.dist < b.dist ? -1 : 1))
9395
expect(info).toMatchSnapshot()
9496
},
9597
)

packages/build/tests/telemetry/tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ test('Telemetry calls timeout by default', async (t) => {
234234
const { telemetryRequests } = await runWithApiMock(t, 'success', {
235235
// Force a client side timeout
236236
telemetryTimeout: 0,
237+
waitTelemetryServer: 1000,
237238
// The error monitor snapshot should contain the timeout error
238239
snapshot: true,
239240
})

0 commit comments

Comments
 (0)