[tests] Stabilize NSPasteboard metadata detection Fixes #25446 - #26232
Conversation
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
There was a problem hiding this comment.
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
.htmlfile used as a real pasteboard file URL input. - Updated three
DetectMetadatatest 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.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [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 macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
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:
Fixes #25446
🤖 Pull request created by Copilot