Skip to content

Fix integration test harness Docker detection + command timeout, and release-testing skill filter syntax#4244

Merged
mattleibow merged 1 commit into
mainfrom
mattleibow-fix-integration-test-harness-reliability
Jun 25, 2026
Merged

Fix integration test harness Docker detection + command timeout, and release-testing skill filter syntax#4244
mattleibow merged 1 commit into
mainfrom
mattleibow-fix-integration-test-harness-reliability

Conversation

@mattleibow

Copy link
Copy Markdown
Collaborator

Summary

Three reliability fixes to the SkiaSharp integration test harness (tests/SkiaSharp.Tests.Integration) and the release-testing skill, all discovered during 4.150.0-preview.2 release testing.

Fixes

1. IsDockerAvailable() deadlock — Linux container tests always skipped

LinuxConsoleTests.IsDockerAvailable() set RedirectStandardOutput/Error = true but never drained the streams before WaitForExit(10000). docker info can emit more than the 64KB OS pipe buffer, so the child blocked on write while the parent's 10s WaitForExit returned falseExitCode access failed → Docker was reported unavailable even when running. Net effect: the Linux container tests were always silently skipped.

Fix: start ReadToEndAsync() on both pipes before WaitForExit, kill on timeout, then Task.WaitAll the reads so a large payload can't deadlock the child.

2. Run() helper timeout never enforced

PlatformTestBase.Run(...) awaited StandardOutput.ReadToEndAsync() / StandardError.ReadToEndAsync() before WaitForExit(timeoutSeconds * 1000). ReadToEndAsync only completes when the stream closes (process exit), so the await blocked until the process finished — the timeout was effectively never enforced (a hung docker build ran unbounded). Fully reading stdout before starting stderr could also deadlock if stderr filled.

Fix: start both pipe reads first, enforce the timeout via WaitForExit while reads are in flight (kill on timeout), then await the drained output. The rest of the method (combined output, exit-code check, return) is unchanged.

3. release-testing skill — stale --filter syntax ignored under MTP

The project migrated to Microsoft.Testing.Platform (xUnit v3) in #4143. Under MTP the VSTest-style dotnet test --filter "FullyQualifiedName~X" is silently ignored and runs ALL tests. The skill's Test Commands still used that syntax.

Fix: updated every occurrence to the MTP form — dotnet test ... -- --filter-class "*X" — keeping MSBuild -p: properties (-p:SkiaSharpVersion=, -p:iOSDevice=, -p:AndroidDeviceId=, etc.) before the -- separator and only the test-platform filter args after it. Added a note explaining that this project uses MTP so the legacy --filter "FullyQualifiedName~..." syntax must be replaced by --filter-class/--filter-method/--filter-namespace (after --).

Verification

  • dotnet build tests/SkiaSharp.Tests.Integration/SkiaSharp.Tests.Integration.csproj succeeds (0 errors; only pre-existing obsolete-API / xUnit analyzer warnings).
  • The Linux/Docker container path could not be executed in-session because Docker is unavailable / disk-full in this environment, so verification was limited to compilation. The skill change is docs-only.

…release-testing skill filter syntax

Three reliability fixes found during 4.150.0-preview.2 release testing:

- IsDockerAvailable() (LinuxConsoleTests.cs): drain stdout/stderr
  asynchronously before WaitForExit so a large `docker info` payload
  can't fill the OS pipe buffer and deadlock the child. Previously the
  10s WaitForExit timed out and Docker was reported unavailable, so the
  Linux container tests were always silently skipped.

- Run() helper (PlatformTestBase.cs): start both pipe reads first and
  enforce the timeout via WaitForExit while reads are in flight, then
  await the drained output. Previously ReadToEndAsync was awaited before
  WaitForExit, so the timeout was never enforced (a hung `docker build`
  ran unbounded) and reading stdout fully before stderr could deadlock.

- release-testing skill (SKILL.md): replace stale VSTest
  `--filter "FullyQualifiedName~..."` syntax (silently ignored under
  Microsoft.Testing.Platform / xUnit v3 since #4143, running ALL tests)
  with MTP `--filter-class "*..."` args after `--`, keeping MSBuild
  `-p:` properties before the separator. Added a note explaining the
  migration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4244

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4244"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4244/packages --name skiasharp-pr-4244
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4244

@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been deployed and is available at:

🔗 View Staging Site
🔗 View Staging Docs
🔗 View Staging Gallery (Blazor)
🔗 View Staging Gallery (Uno Platform)
🔗 View Staging SkiaFiddle

This preview will be updated automatically when you push new commits to this PR.


This comment is automatically updated by the documentation staging workflow.

@mattleibow mattleibow merged commit 6584c0b into main Jun 25, 2026
5 of 6 checks passed
@mattleibow mattleibow deleted the mattleibow-fix-integration-test-harness-reliability branch June 25, 2026 18:07
@mattleibow mattleibow added this to the 4.150.0-rc.1 milestone Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant