From 0dfb04ebe36362fd3821aeddd88e3dbe8384c2ec Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 30 Aug 2025 21:34:22 -0400 Subject: [PATCH 1/2] Fix test flakiness in node-core-library. --- .../node-core-library/fix-tests_2025-08-31-01-31.json | 11 +++++++++++ .../node-core-library/src/test/FileSystem.test.ts | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 common/changes/@rushstack/node-core-library/fix-tests_2025-08-31-01-31.json diff --git a/common/changes/@rushstack/node-core-library/fix-tests_2025-08-31-01-31.json b/common/changes/@rushstack/node-core-library/fix-tests_2025-08-31-01-31.json new file mode 100644 index 00000000000..db57b2feb86 --- /dev/null +++ b/common/changes/@rushstack/node-core-library/fix-tests_2025-08-31-01-31.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "", + "type": "none", + "packageName": "@rushstack/node-core-library" + } + ], + "packageName": "@rushstack/node-core-library", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/libraries/node-core-library/src/test/FileSystem.test.ts b/libraries/node-core-library/src/test/FileSystem.test.ts index 0712f630c38..05e257d4917 100644 --- a/libraries/node-core-library/src/test/FileSystem.test.ts +++ b/libraries/node-core-library/src/test/FileSystem.test.ts @@ -43,10 +43,9 @@ describe(FileSystem.name, () => { }); test('Should return true for an error on a file descriptor call', () => { - const buffer: Buffer = Buffer.allocUnsafeSlow(1024); expect.assertions(1); try { - fs.readSync(11, buffer, 0, buffer.length, -1); + fs.readFileSync(`${__dirname}/nonexistent.txt`); } catch (error) { expect(FileSystem.isErrnoException(error)).toBe(true); } From dfc26f22496d210fddcaedf9068142c9114cdced Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 30 Aug 2025 22:01:26 -0400 Subject: [PATCH 2/2] Fix some test flakiness in rush-lib. --- .../api-extractor-test-05/dist/tsdoc-metadata.json | 2 +- .../@microsoft/rush/fix-tests_2025-08-31-02-01.json | 10 ++++++++++ .../src/cli/test/RushCommandLineParser.test.ts | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 common/changes/@microsoft/rush/fix-tests_2025-08-31-02-01.json diff --git a/build-tests/api-extractor-test-05/dist/tsdoc-metadata.json b/build-tests/api-extractor-test-05/dist/tsdoc-metadata.json index 89625ac60e4..5b39d9101b7 100644 --- a/build-tests/api-extractor-test-05/dist/tsdoc-metadata.json +++ b/build-tests/api-extractor-test-05/dist/tsdoc-metadata.json @@ -5,7 +5,7 @@ "toolPackages": [ { "packageName": "@microsoft/api-extractor", - "packageVersion": "7.52.8" + "packageVersion": "7.52.11" } ] } diff --git a/common/changes/@microsoft/rush/fix-tests_2025-08-31-02-01.json b/common/changes/@microsoft/rush/fix-tests_2025-08-31-02-01.json new file mode 100644 index 00000000000..bd7ff97cb34 --- /dev/null +++ b/common/changes/@microsoft/rush/fix-tests_2025-08-31-02-01.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/cli/test/RushCommandLineParser.test.ts b/libraries/rush-lib/src/cli/test/RushCommandLineParser.test.ts index a8122091dd1..02da1daeac7 100644 --- a/libraries/rush-lib/src/cli/test/RushCommandLineParser.test.ts +++ b/libraries/rush-lib/src/cli/test/RushCommandLineParser.test.ts @@ -47,6 +47,10 @@ describe('RushCommandLineParser', () => { afterEach(() => { jest.clearAllMocks(); EnvironmentConfiguration.reset(); + jest + .spyOn(EnvironmentConfiguration, 'buildCacheOverrideJsonFilePath', 'get') + .mockReturnValue(undefined); + jest.spyOn(EnvironmentConfiguration, 'buildCacheOverrideJson', 'get').mockReturnValue(undefined); }); describe('in basic repo', () => {