Skip to content

Commit f40527d

Browse files
TheLarkInnCopilot
andcommitted
Harden tests that time out on busy Windows runners
Rush 5.181.0 fixed the critical-path priority in AsyncOperationQueue. `rush retest` now runs the test operations after the builds, so the heaviest suites overlap at the end of CI, and some tests run twice as slowly on the 4-vCPU Windows runners. - NativeBuildTestFixture: raise the daemon idle timeout from 30 s to 600 s. The timer counts from the end of the last request, and a status ping doesn't reset it, so a slow gap let the daemon exit between two requests of a test. closeAsync() still stops the daemon. - RushProjectConfiguration and PhasedCommandEngineAbort tests: 30 s timeout, not 5 s. - OutputFolderDigester threshold test: give the serial digester a 60 s threshold, so a slow digest can't start its pool. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2fdae5a5-bbb9-4f39-a3e0-c0d21203e97a
1 parent 56efa66 commit f40527d

7 files changed

Lines changed: 50 additions & 2 deletions

File tree

‎apps/rush-cli-client/src/test/NativeBuildTestFixture.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ export function createNativeBuildTestFixture(): INativeBuildTestFixture {
6666
rushVersion: Rush.version,
6767
suppressNodeLtsWarning: true,
6868
npmVersion: '10.0.0',
69-
daemon: { enabled: true, autoStart: true, idleTimeoutSeconds: 30 },
69+
// The idle timer counts from the end of the last request; a status ping doesn't reset it. A busy
70+
// Windows runner can leave more than 30 s between a test's requests, and a new daemon then serves the
71+
// next one. closeAsync() stops the daemon.
72+
daemon: { enabled: true, autoStart: true, idleTimeoutSeconds: 600 },
7073
projectFolderMinDepth: 1,
7174
projects: ['a', 'b'].map((name) => ({ packageName: name, projectFolder: name }))
7275
})
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush",
10+
"email": "3408176+TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-cli-client",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-cli-client",
10+
"email": "3408176+TheLarkInn@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rush-daemon",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/rush-daemon",
10+
"email": "3408176+TheLarkInn@users.noreply.github.com"
11+
}

‎libraries/rush-daemon/src/test/OutputFolderDigestPool.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,11 @@ describe(OutputFolderDigester.name, () => {
418418

419419
it('starts a pool only after a digest on the calling thread takes longer than the threshold', () => {
420420
const folderSets: IOutputFolderSet[] = createProjects(root);
421-
const serial: OutputFolderDigester = new OutputFolderDigester({ threadCount: 2 });
421+
// A threshold that no digest of these small folders reaches, even on a busy machine.
422+
const serial: OutputFolderDigester = new OutputFolderDigester({
423+
threadCount: 2,
424+
poolStartThresholdMs: 60_000
425+
});
422426
expect(serial.digest(folderSets)).toEqual(digestOnCallingThread(folderSets));
423427
expect(serial.isParallel).toBe(false);
424428

‎libraries/rush-daemon/src/test/PhasedCommandEngineAbort.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import { NoOpTerminalProvider } from '@rushstack/terminal';
1515

1616
import { DaemonGraphTestFixture } from './DaemonGraphTestFixture';
1717

18+
// Each case creates a Git repository and loads a real Rush configuration, which can take more than the
19+
// default 5 s on a busy Windows runner.
20+
jest.setTimeout(30_000);
21+
1822
const STEP_PREFIX: string = 'rush:phasedScriptAction:';
1923

2024
/** The steps that the native preparation measures for the fixture's `build`, in their order. */

‎libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import type { RushConfigurationProject } from '../RushConfigurationProject';
1414
import { RushProjectConfiguration } from '../RushProjectConfiguration';
1515
import { PhasedCommandEngineProjectConfigurationError } from '../PhasedCommandEngineProjectConfigurationError';
1616

17+
// Several cases write, link and stat many files, which can take more than the default 5 s on a busy
18+
// Windows runner.
19+
jest.setTimeout(30_000);
20+
1721
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1822
function stripSymbolsFromObject(obj: any | undefined): void {
1923
if (obj) {

0 commit comments

Comments
 (0)