From 7b872ad2b945b239a84a33f7ac546683dae344f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristina=20Ca=C3=B1izales?= <113132642+CristiCanizales@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:31:15 -0300 Subject: [PATCH] test: fix unit test flapper in linux (#5871) --- .../telemetry/reporters/appInsights.test.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/appInsights.test.ts b/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/appInsights.test.ts index 848c408f16..c96ce1a1cc 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/appInsights.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/appInsights.test.ts @@ -168,7 +168,22 @@ describe('AppInsights', () => { let appInsights: AppInsights; beforeEach(() => { - jest.spyOn(os, 'hostname').mockReturnValue('test.internal.salesforce.com'); + jest + .spyOn(os, 'hostname') + .mockReturnValue('test.internal.salesforce.com'); + jest.spyOn(os, 'cpus').mockReturnValue([ + { + model: 'AMD EPYC 7763 64-Core Processor', + speed: 3242, + times: { + user: 100000, + nice: 0, + sys: 100000, + idle: 1000000, + irq: 0 + } + } + ]); jest.spyOn(os, 'userInfo').mockReturnValue({ username: 'testuser', uid: 1001,