Skip to content

Commit 2ca1c62

Browse files
authored
ci(react-native): addressing detox build flakes (#1250)
This PR will attempt to stablize the react native detox e2e tests in the CI pipelie. There are 2 changes: 1. We added 2 retry as 1 CI rerun will typically resolve the issue 2. We added the event and streaming urls to the detox url blacklist <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/launchdarkly/js-core/pull/1250" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk since changes are limited to CI test invocation and Detox synchronization settings, with no production runtime impact. Main risk is masking legitimate failures or over-broad URL blacklisting causing tests to miss regressions. > > **Overview** > Stabilizes the React Native example Detox Android CI by adding `--retries 2` to the Detox test run so transient emulator/test flakes are automatically retried. > > Updates the e2e app launch args to broaden `detoxURLBlacklistRegex` to include LaunchDarkly streaming, SDK, and events endpoints, preventing ongoing network activity from blocking Detox test synchronization. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit bd46d35. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 109efb4 commit 2ca1c62

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/react-native-detox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
arch: x86_64
8686
avd-name: ${{ steps.device.outputs.AVD_NAME }}
8787
working-directory: packages/sdk/react-native/example
88-
script: yarn detox test --configuration android.emu.release --headless --record-logs all
88+
script: yarn detox test --configuration android.emu.release --headless --record-logs all --retries 2
8989

9090
- name: Upload artifacts
9191
if: always()

packages/sdk/react-native/example/e2e/starter.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ describe('given the example application', () => {
55
await device.launchApp({
66
newInstance: true,
77
launchArgs: {
8-
// Detox will wait for HTTP requests to complete. This prevents detox from waiting for
9-
// requests matching this URL to complete.
10-
detoxURLBlacklistRegex: '\\("^https://clientstream.launchdarkly.com/meval.*"\\)',
8+
// Detox waits for HTTP requests to complete. Blacklist all LD endpoints so
9+
// streaming, polling, and event requests don't block test synchronization.
10+
detoxURLBlacklistRegex:
11+
'\\(".*clientstream.launchdarkly.com.*",".*clientsdk.launchdarkly.com.*",".*events.launchdarkly.com.*"\\)',
1112
},
1213
});
1314
});

0 commit comments

Comments
 (0)