Skip to content

test(download): retry media-download Windows tests to absorb runner cold-start variance#1708

Open
Benjamin-eecs wants to merge 2 commits into
jackwener:mainfrom
Benjamin-eecs:fix/media-download-test-windows-flake
Open

test(download): retry media-download Windows tests to absorb runner cold-start variance#1708
Benjamin-eecs wants to merge 2 commits into
jackwener:mainfrom
Benjamin-eecs:fix/media-download-test-windows-flake

Conversation

@Benjamin-eecs
Copy link
Copy Markdown
Contributor

@Benjamin-eecs Benjamin-eecs commented May 21, 2026

Description

CI run 26217100578 (Windows shard 2/2 on commit d4640b24) failed with src/download/media-download.test.ts > 'keeps custom filenames inside the output directory' timing out at the default 5000ms.

The other two tests in the same describe block completed in ~417ms and ~156ms on the same run, so the failure is cold-start cost of the first http.createServer + downloadMedia roundtrip on a loaded GitHub Actions Windows runner, not a logic regression. The 14 previous main commits in the last 5 days passed this exact shard.

Adopt the same { retry: process.platform === 'win32' ? 2 : 0 } describe option that src/download/index.test.ts:36 already uses for the same class of Windows-only network/IO flake (the sibling's comment cites Windows Defender locking .tmp files; the underlying cause class is shared).

Related issue: (none)

Type of Change

  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Screenshots / Output

CI failure summary (Windows shard 2/2, run 26217100578):

src/download/media-download.test.ts > media downloads
  keeps custom filenames inside the output directory  FAILED  21908ms (timed out at 5000ms)
  strips nested and absolute path components from custom filenames  passed  417ms
  falls back to generated names for empty dot-directory filenames  passed  156ms

 Test Files  1 failed | 38 passed (39)
      Tests  1 failed | 419 passed | 3 skipped (423)

Local re-run after the fix (3 tests pass under the new retry option):

$ npx vitest run src/download/media-download.test.ts
 Test Files  1 passed (1)
      Tests  3 passed (3)
   Duration  200ms

@Benjamin-eecs Benjamin-eecs marked this pull request as ready for review May 21, 2026 10:15
Copilot AI review requested due to automatic review settings May 21, 2026 10:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a Windows-only CI flake in the media download tests by adding a Vitest retry policy to absorb occasional cold-start/timing variance on GitHub Actions Windows runners.

Changes:

  • Adds a Windows-only { retry: 2 } option to the media downloads test describe block.
  • Documents the rationale for the retry (first roundtrip occasionally exceeding the default 5s timeout on loaded Windows runners).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…old-start variance

src/download/media-download.test.ts > 'keeps custom filenames inside the
output directory' timed out at the default 5000ms on CI run 26217100578
(Windows shard 2/2). The other two cases in the same describe block
completed in ~400ms, so the failure is cold-start cost of the first
http.createServer + downloadMedia roundtrip on a loaded GitHub Actions
Windows runner, not a logic regression.

Adopt the same { retry: process.platform === 'win32' ? 2 : 0 } describe
option that src/download/index.test.ts already uses for the same class
of Windows-only network/IO flake.
src/download/index.test.ts uses a 2-line comment for the same pattern.
The CI run id + redundant cross-reference belong in commit history, not
inline.
@Benjamin-eecs Benjamin-eecs force-pushed the fix/media-download-test-windows-flake branch from 4e6f5b1 to 8abcaed Compare May 22, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants