Skip to content

fix: increase MPLatch timeout from 5s to 30s#695

Merged
rmi22186 merged 2 commits intomainfrom
fix/increase-mplatch-timeout
Apr 8, 2026
Merged

fix: increase MPLatch timeout from 5s to 30s#695
rmi22186 merged 2 commits intomainfrom
fix/increase-mplatch-timeout

Conversation

@rmi22186
Copy link
Copy Markdown
Member

@rmi22186 rmi22186 commented Apr 7, 2026

Summary

  • Increases the MPLatch await timeout from 5 seconds to 30 seconds
  • The 5-second timeout is too short for MParticleJSInterfaceITest WebView JS bridge tests running on newer GitHub Actions runner images (ubuntu24/20260309.50+)
  • Tests started consistently failing on March 12, 2026 when the runner image updated — no code changes in either the web SDK or Android SDK caused the regression
  • The workflow-level timeout-minutes: 15 still guards against genuine hangs

Context

The MParticleJSInterfaceITest tests in mparticle-web-sdk's Android Bridge Tests workflow have been failing since the GitHub Actions runner image updated from ubuntu24/20260302.42 to ubuntu24/20260309.50. We verified:

  • Same web SDK code (byte-for-byte identical mparticle.js) passes on old runner, fails on new
  • Same Android SDK commit (892a7783) in both passing and failing runs
  • Downgrading platform-tools to 36.0.2 does not fix it
  • Bumping emulator API level from 29 to 34 reduces failures (1/10 vs 2+/10) but doesn't eliminate them
  • The root cause is environmental changes in the runner image that slow WebView/JS initialization beyond the 5-second latch timeout

Test plan

  • Verify MParticleJSInterfaceITest passes in Android SDK CI
  • After merge, verify Android Bridge Tests in mparticle-web-sdk pass consistently

🤖 Generated with Claude Code

The 5-second timeout is too short for WebView JS bridge tests running
on newer GitHub Actions runner images (ubuntu24/20260309.50+). The
MParticleJSInterfaceITest tests consistently fail because JS execution
in the emulator WebView doesn't complete within 5 seconds on these
environments.

Increasing to 30 seconds provides sufficient margin while still
catching genuine hangs via the workflow-level timeout-minutes: 15.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rmi22186 rmi22186 requested a review from a team as a code owner April 7, 2026 21:13
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 7, 2026

PR Summary

Low Risk
Low risk: only updates Android instrumentation tests to wait longer for WebView/JS callbacks, reducing flakiness without changing production code paths.

Overview
Increases the wait time for WebView/JS bridge callbacks in MParticleJSInterfaceITest by replacing unbounded latch.await() calls with a WEBVIEW_TIMEOUT_SECONDS (30s) timed await.

This standardizes timeouts across multiple JS-bridge tests and should reduce CI flakiness on slower environments while keeping the suite bounded by an explicit upper limit.

Reviewed by Cursor Bugbot for commit 48f497f. Bugbot is set up for automated code reviews on this repo. Configure here.

rmi22186 added a commit to mParticle/mparticle-web-sdk that referenced this pull request Apr 8, 2026
The Android bridge tests have been failing since March 12, 2026 due
to a GitHub Actions runner image update (ubuntu24/20260309.50) that
slowed WebView/JS initialization beyond the 5-second MPLatch timeout.

Points the android-sdk ref at fix/increase-mplatch-timeout which
increases the timeout from 5s to 30s. Should be switched back to
main once mParticle/mparticle-android-sdk#695 is merged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of increasing the global MPLatch timeout (used by 20+ test
files), use an explicit 30-second await in MParticleJSInterfaceITest
only. WebView JS execution needs more time on newer CI runner images,
but other tests don't need the longer timeout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

@rmi22186 rmi22186 merged commit 20f723f into main Apr 8, 2026
17 of 18 checks passed
@rmi22186 rmi22186 deleted the fix/increase-mplatch-timeout branch April 8, 2026 15:41
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