Skip to content

Stabilize browser CI checks#8

Closed
KSemenenko wants to merge 2 commits intomainfrom
codex/fix-release-pipeline-browser-flakes
Closed

Stabilize browser CI checks#8
KSemenenko wants to merge 2 commits intomainfrom
codex/fix-release-pipeline-browser-flakes

Conversation

@KSemenenko
Copy link
Copy Markdown
Member

Summary

  • align the editor overlay test with the standard editor startup visibility timeout
  • make the saved-recording harness sample multiple frames before treating a video as visually black
  • make learn startup tracing deterministic across early animation frames to avoid warmed-suite flakiness

Verification

  • dotnet build /private/tmp/prompterone-ci-fix-XoJTzs/repo/PrompterOne.slnx -warnaserror
  • dotnet test /private/tmp/prompterone-ci-fix-XoJTzs/repo/PrompterOne.slnx
  • dotnet format /private/tmp/prompterone-ci-fix-XoJTzs/repo/PrompterOne.slnx
  • dotnet build /private/tmp/prompterone-ci-fix-XoJTzs/repo/PrompterOne.slnx -warnaserror
  • dotnet test /private/tmp/prompterone-ci-fix-XoJTzs/repo/PrompterOne.slnx

Copilot AI review requested due to automatic review settings April 2, 2026 19:24
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 aims to reduce browser UI test flakiness in CI by standardizing visibility timeouts, improving saved-recording visual validation, and making Learn startup tracing more deterministic across early frames.

Changes:

  • Align editor overlay visibility waiting with the shared default visible timeout.
  • Update the saved-recording harness to probe multiple video frames before concluding the recording is visually black.
  • Add deterministic requestAnimationFrame-based sampling to Learn startup tracing.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/PrompterOne.App.UITests/Media/recording-file-harness.js Adds multi-frame probing for visible video detection in the recording analysis harness.
tests/PrompterOne.App.UITests/Learn/LearnStartupAlignmentTests.cs Adds early-frame sampling via requestAnimationFrame to stabilize startup trace collection.
tests/PrompterOne.App.UITests/Editor/EditorOverlayInteractionTests.cs Uses the shared default visible timeout when waiting for the editor source input.

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

Comment on lines +120 to +127
async function waitForNextVideoFrame(videoElement) {
if (typeof videoElement.requestVideoFrameCallback === "function") {
await new Promise(resolve => videoElement.requestVideoFrameCallback(() => resolve()));
return;
}

await new Promise(resolve => window.setTimeout(resolve, visibleVideoPollDelayMs));
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

waitForNextVideoFrame can hang indefinitely when requestVideoFrameCallback never fires (e.g., if videoElement.play() fails or the video never advances frames). Because this await has no timeout, detectVisibleVideoAcrossFrames may never reach its deadline and the harness can stall the test run. Consider racing requestVideoFrameCallback with a setTimeout fallback (or check paused/ended and fall back to polling) so the probe always makes progress and respects visibleVideoProbeTimeoutMs.

Copilot uses AI. Check for mistakes.
Comment on lines +104 to +110
capture();

if (window.__learnStartupTrace.length >= maxSamples || animationFramePasses >= maxAnimationFramePasses) {
return;
}

animationFramePasses += 1;
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

animationFramePasses is checked before it is incremented, so captureOnAnimationFrame will run one extra requestAnimationFrame callback beyond maxAnimationFramePasses (it still captures once more before returning). If the intent is to cap RAF sampling to exactly maxAnimationFramePasses, increment before the check or adjust the comparison so the maximum number of scheduled passes matches the constant.

Suggested change
capture();
if (window.__learnStartupTrace.length >= maxSamples || animationFramePasses >= maxAnimationFramePasses) {
return;
}
animationFramePasses += 1;
if (window.__learnStartupTrace.length >= maxSamples || animationFramePasses >= maxAnimationFramePasses) {
return;
}
animationFramePasses += 1;
capture();
if (window.__learnStartupTrace.length >= maxSamples || animationFramePasses >= maxAnimationFramePasses) {
return;
}

Copilot uses AI. Check for mistakes.
@KSemenenko
Copy link
Copy Markdown
Member Author

part of #9

@KSemenenko KSemenenko closed this Apr 2, 2026
@KSemenenko KSemenenko deleted the codex/fix-release-pipeline-browser-flakes branch April 3, 2026 11:47
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