Skip to content

test: fix main-red tests on macOS and Windows (glupload format, partial file size, filesrc paths) - #1050

Merged
srperens merged 2 commits into
mainfrom
fix/main-red-test-races
Oct 8, 2026
Merged

srperens merged 2 commits into
mainfrom
fix/main-red-test-races

Conversation

@srperens

@srperens srperens commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #1033, #1043, #1034

Problem

Main is red on macOS and Windows on two tests:

Both are test races, not product bugs. A third failure surfaced on this PR's own run: 13 live_recorder_test tests (from #1034) fail on Windows with StateChangeError.

Change

  • glupload format: after a switch to CUDA the test checked glupload's sink caps once. The adapters change before the new CAPS event reaches glupload. The PGM wait proves nothing here either, because PGM is already white from frames before the switch. A new helper, wait_for_upload_format, polls with a 15 s deadline. vision_mixer_input_format_test.rs had the same one-shot check, so it uses the helper too.
  • Partial file size: the test read the file size with DirEntry::metadata(). On Windows that is the size in the directory listing, which NTFS does not update while the writer holds the file open. std::fs::metadata(path) opens the file and returns its real size.

The guards stay intact: if the converter were never bypassed, glupload would never get NV12, and the wait would time out and fail.

  • Windows paths in launch strings: live_recorder_test put the recorded file's path in a parse::launch string (filesrc location="C:\..."). The parser reads backslashes there as escapes, so the read-back pipeline fails to start. location is now set as a property. The same fix is applied to the PNG writer in the stinger examples' unit test. The stinger tests have the same bug; test(stinger): run the stinger tests one at a time, and pass file paths as properties #1051 fixes those.

Evidence

  • glupload race: the macOS CI log of run 37749122303 shows the stale A444_16LE. Run 37758507367 passed the same test with the same code.
  • Windows size: this PR's first CI run passed partial_download_never_appears_under_the_final_name on Windows, and cuda_after_a_converted_format_bypasses_the_converter on macOS.
  • Recorder paths: unverified on Windows until the next run.

Tests

Ran on macOS (arm64), in the worktree: cargo test --test media_download_test --test vision_mixer_input_format_test --test vision_mixer_input_format_cuda_test. Results: 15/15, 14/14, and 1 passed. Also ran cargo test --test live_recorder_test (18/18) and cargo test --lib stinger::examples (6 passed, 1 ignored). cargo fmt --check and cargo clippy --all-targets are clean.
Skipped: nvdec_cuda_after_a_converted_format_stays_on_the_gpu (needs an NVIDIA GPU).
Not run locally: Windows. ci:windows and ci:macos are set so both runners execute these tests.

Out of scope

The stinger tests from #1010 also fail on main, on Linux, macOS and Windows: frame counts, "stinger never ready", and Access is denied when a clip is rewritten on Windows. #1051 handles those. One more: gpu_converter_comes_out_when_the_format_switches_back failed once on this PR's Linux run, with the pipeline stuck going from Paused to Playing. It passed on the macOS and Windows runners and locally, so it looks like the known GL-runner flake. Not chased here.

🤖 Generated with Claude Code

Two tests that keep main red on macOS and Windows:

- vision_mixer_input_format_cuda_test read glupload's sink caps once,
  right after the adapters changed. The CAPS event can still be on its
  way, and PGM is already white from frames before the switch, so the
  check saw A444_16LE instead of NV12. Poll for the format with a
  deadline instead, here and in vision_mixer_input_format_test.
- media_download_test read the partial file's size with
  DirEntry::metadata, which on Windows is the directory listing's
  size. NTFS does not update it while the writer holds the file open,
  so the test never saw the first half. Use std::fs::metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@srperens srperens added ci:macos Run Build (macOS) on this pull request ci:windows Run Build (Windows) on this pull request labels Oct 8, 2026
live_recorder_test put the recorded file's path inside a parse::launch
string, where a Windows path's backslashes are read as escapes, so 13
tests failed to start their read-back pipeline on Windows. Set
`location` as a property, and do the same in the stinger examples'
PNG writer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@srperens srperens changed the title test: wait for glupload's format and read a growing file's real size test: fix main-red tests on macOS and Windows (glupload format, partial file size, filesrc paths) Oct 8, 2026
@srperens
srperens merged commit ccb7efe into main Oct 8, 2026
6 of 9 checks passed
@srperens
srperens deleted the fix/main-red-test-races branch October 12, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:macos Run Build (macOS) on this pull request ci:windows Run Build (Windows) on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant