Skip to content

[tests] Stabilize NSPasteboard metadata detection Fixes #25446 - #26232

Merged
rolfbjarne merged 1 commit into
mainfrom
dev/rolf/dev-rolf-issue-25446-ci-postmortem-flaky
Jul 22, 2026
Merged

[tests] Stabilize NSPasteboard metadata detection Fixes #25446#26232
rolfbjarne merged 1 commit into
mainfrom
dev/rolf/dev-rolf-issue-25446-ci-postmortem-flaky

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

The macOS pasteboard can return cached empty metadata results when the test repeatedly queries unchanged contents. Use an actual isolated HTML file and rewrite the pasteboard before each retry so that AppKit observes a new change count.

Assert pasteboard writes and callback errors for every attempt, and log the change count when an attempt returns no metadata.

Validation:

  • Clean managed build.
  • macOS monotouch test source compilation.
  • Runtime execution was unavailable locally because this branch requires Xcode 26.6 and the installed version is Xcode 26.3.

Fixes #25446

🤖 Pull request created by Copilot

Use an actual temporary HTML file for content-type detection, and rewrite the pasteboard contents before each retry so that AppKit sees a new change count instead of reusing a cached empty result. Assert pasteboard writes and per-attempt errors, and log empty attempts for future diagnostics.

Fixes #25446

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e26680b7-5c7b-472b-bf8a-7002f76fc3b6
Copilot AI review requested due to automatic review settings July 22, 2026 08:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Stabilizes the macOS NSPasteboard metadata detection tests by ensuring each retry presents AppKit with a fresh pasteboard write and a real on-disk HTML file, addressing flakiness reported in #25446.

Changes:

  • Added a helper to create a temporary .html file used as a real pasteboard file URL input.
  • Updated three DetectMetadata test variants to rewrite pasteboard contents on each retry attempt and assert pasteboard writes + callback errors per attempt.
  • Added extra diagnostic logging (including pasteboard change count) when a retry returns empty metadata.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: e094a26829c95306641819f4d16876738bf0507b [PR build]

@rolfbjarne
rolfbjarne enabled auto-merge (squash) July 22, 2026 12:24
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #e094a26] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 203 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: e094a26829c95306641819f4d16876738bf0507b [PR build]

@rolfbjarne
rolfbjarne merged commit 6d1ccd3 into main Jul 22, 2026
57 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/dev-rolf-issue-25446-ci-postmortem-flaky branch July 22, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI Postmortem] Flaky: NSPasteboardTests.DetectMetadataTests_SomewhatStronglyTyped on macOS

4 participants