Skip to content

test(e2e): Widen WebView demo-page trace poll window to de-flake e2e - #6950

Merged
antonis merged 1 commit into
mainfrom
test/webview-e2e-poll-window
Oct 29, 2026
Merged

antonis merged 1 commit into
mainfrom
test/webview-e2e-poll-window

Conversation

@antonis

@antonis antonis commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Enhancement (test stability)

📜 Description

De-flakes the webViewTraceConnection Android e2e. The sample's WebView demo page polls for the injected sentry-trace meta tag, reads it back, and flips the on-device "WebView trace connected" status the e2e asserts on. That poll window was 3s (30 × 100ms). On Android the injection is asynchronous (react-native-webview injects via onPageStarted + evaluateJavascript), and a cold-start release build on a slow CI emulator can land the injection later than on a local device — so the page intermittently declared the trace (none — not injected) before it arrived and the e2e timed out at 30s, even though the feature works.

Widen the poll window to 20s (maxTries = 200), still well within the e2e's 30s extendedWaitUntil on the connected status, so a late injection is caught instead of prematurely declared missing.

Sample/e2e-only — no SDK change, no public API change, no CHANGELOG entry.

💡 Motivation and Context

webViewTraceConnection.test flaked on CI (e.g. runs on unrelated PRs) with Assertion is false: "WebView trace connected.*". Confirmed a flake, not a regression: the identical main commit passes it in ~7s; passing runs connect fast while the failure timed out at the full 30s (race-loss signature). The change only affects the sample's readback loop, not the feature or its "fails safe to a new trace" behavior.

💚 How did you test it?

Validated by the full Android e2e run on this PR (enabled via the ready-to-merge label), which exercises webViewTraceConnection on the API 30 release build.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

None.

🤖 Generated with Claude Code

The WebView demo page polls for the injected `sentry-trace` meta tag to
read it back and flip the on-device "WebView trace connected" status the
`webViewTraceConnection` e2e asserts on. The window was 3s (30 * 100ms).

On Android the injection is asynchronous, and a cold-start release build
on a slow CI emulator can land it later than on a local device, so the
page intermittently declared the trace "not injected" before it arrived —
flaking the e2e (timed out at 30s) even though the feature works.

Widen the poll window to 20s, still well within the e2e's 30s wait on the
connected status. Sample/e2e-only; no SDK change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • test(e2e): Widen WebView demo-page trace poll window to de-flake e2e by antonis in #6950
  • chore(deps): update Android SDK to v8.62.0 by github-actions in #6932
  • chore(deps): update Maestro to v2.12.0 by github-actions in #6945
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.35.0 to 3.0.0 by dependabot in #6944
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6940
  • chore(deps): bump actions/upload-artifact from 7.0.1 to 7.0.2 by dependabot in #6941
  • chore(deps): bump fast-uri from 3.1.8 to 3.1.9 by dependabot in #6946
  • chore(deps): bump undici from 6.29.0 to 6.29.1 by dependabot in #6947
  • chore(deps): bump actions/setup-node from 7.0.0 to 7.1.0 by dependabot in #6943
  • chore(deps): bump ruby/setup-ruby from 1.327.0 to 1.334.0 by dependabot in #6942
  • chore(deps): bump ip-address from 10.7.2 to 10.7.4 by dependabot in #6939
  • chore(deps): update Wizard to v9.0.0 by github-actions in #6936
  • chore(deps): update CLI to v3.8.2 by github-actions in #6933
  • ci: Move CI off end-of-life Node versions to Node 22 by antonis in #6927

🤖 This preview updates automatically when you update the PR.

@sentry

sentry Bot commented Oct 27, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.32.0 (112) Release

⚙️ sentry-react-native Build Distribution Settings

@antonis
antonis marked this pull request as ready for review October 27, 2026 10:50

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@antonis
antonis merged commit 09748d6 into main Oct 29, 2026
105 of 129 checks passed
@antonis
antonis deleted the test/webview-e2e-poll-window branch October 29, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants