mirror of
https://github.com/herdrdev/herdr.git
synced 2026-09-14 18:03:41 +08:00
test: relax windows docs snapshot timeout (#4049)
Windows CI runs these documentation contract fixtures under variable load. A degraded runner pushed the preview and versions snapshot integration tests past their 30s ceiling, while a healthy run finishes in seconds. Keep 30s elsewhere and give Windows a 120s ceiling.
This commit is contained in:
@@ -7,6 +7,11 @@ import { tmpdir } from 'node:os';
|
||||
const script = resolve(import.meta.dir, 'preview.mjs');
|
||||
const temporaryDirectories: string[] = [];
|
||||
|
||||
// The fixture shells out to node and git many times. A healthy Windows runner
|
||||
// finishes in seconds, but a degraded one can run an order of magnitude slower,
|
||||
// so keep a generous ceiling instead of making the suite a load-sensitive flake.
|
||||
const fixtureTimeoutMs = process.platform === 'win32' ? 120_000 : 30_000;
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all(
|
||||
temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true, force: true })),
|
||||
@@ -27,7 +32,7 @@ describe('preview documentation snapshots', () => {
|
||||
'selected preview\n',
|
||||
);
|
||||
await expect(read(root, 'docs/preview/website/stale.mdx')).rejects.toThrow();
|
||||
}, 30_000);
|
||||
}, fixtureTimeoutMs);
|
||||
|
||||
test('rejects snapshot drift', async () => {
|
||||
const root = await fixture();
|
||||
@@ -37,7 +42,7 @@ describe('preview documentation snapshots', () => {
|
||||
await write(root, 'docs/preview/website/src/content/docs/index.mdx', 'changed\n');
|
||||
|
||||
expect(() => runScript(root, ['check'])).toThrow();
|
||||
}, 30_000);
|
||||
}, fixtureTimeoutMs);
|
||||
});
|
||||
|
||||
async function fixture() {
|
||||
|
||||
@@ -7,6 +7,11 @@ import { tmpdir } from 'node:os';
|
||||
const script = resolve(import.meta.dir, 'versions.mjs');
|
||||
const temporaryDirectories: string[] = [];
|
||||
|
||||
// The fixture shells out to node and git many times. A healthy Windows runner
|
||||
// finishes in seconds, but a degraded one can run an order of magnitude slower,
|
||||
// so keep a generous ceiling instead of making the suite a load-sensitive flake.
|
||||
const fixtureTimeoutMs = process.platform === 'win32' ? 120_000 : 30_000;
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all(
|
||||
temporaryDirectories.splice(0).map((path) => rm(path, { recursive: true, force: true })),
|
||||
@@ -103,7 +108,7 @@ describe('documentation release publishing', () => {
|
||||
delete archivedManifest.versions[0].commit;
|
||||
await write(root, 'docs/versions/manifest.json', `${JSON.stringify(archivedManifest)}\n`);
|
||||
expect(() => runScript(root, ['check'])).toThrow();
|
||||
}, 30_000);
|
||||
}, fixtureTimeoutMs);
|
||||
});
|
||||
|
||||
async function write(root: string, path: string, content: string) {
|
||||
|
||||
Reference in New Issue
Block a user