You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/docs/getting-started/configuration.mdx
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,12 @@ For Expo projects, the `entryPoint` should be set to the path specified in the `
93
93
// Optional: Bridge timeout in milliseconds (default: 60000)
94
94
bridgeTimeout?:number;
95
95
96
+
// Optional: Bundle start timeout in milliseconds (default: 15000)
97
+
bundleStartTimeout?:number;
98
+
99
+
// Optional: Maximum number of app restarts when app fails to report ready (default: 2)
100
+
maxAppRestarts?:number;
101
+
96
102
// Optional: Reset environment between test files (default: true)
97
103
resetEnvironmentBetweenTestFiles?:boolean;
98
104
}
@@ -249,6 +255,39 @@ Increase this value if you experience timeout errors, especially on:
249
255
- Slower devices or simulators
250
256
- Complex test suites with heavy setup
251
257
258
+
## Bundle Start Timeout
259
+
260
+
The bundle start timeout controls how long React Native Harness waits for Metro to start bundling after the app is restarted. This timeout is used in conjunction with the app restart mechanism to detect when an app has failed to report ready.
261
+
262
+
```javascript
263
+
{
264
+
bundleStartTimeout:30000, // 30 seconds in milliseconds
265
+
}
266
+
```
267
+
268
+
**Default:** 15000 (15 seconds)
269
+
**Minimum:** 1000 (1 second)
270
+
271
+
This timeout works with the `maxAppRestarts` setting to automatically restart the app when it fails to communicate with the test harness. If no bundling activity is detected within this timeout period, the app will be restarted automatically.
272
+
273
+
## Maximum App Restarts
274
+
275
+
The maximum app restarts setting controls how many times React Native Harness will attempt to restart the app when it fails to report ready within the configured timeout periods.
276
+
277
+
```javascript
278
+
{
279
+
maxAppRestarts:3, // Allow up to 3 restart attempts
280
+
}
281
+
```
282
+
283
+
**Default:** 2
284
+
**Minimum:** 0
285
+
286
+
When set to 0, automatic app restarting is disabled. Higher values provide more resilience against flaky test environments but may increase test execution time. The app will be restarted when:
287
+
288
+
- No bundling activity is detected within the `bundleStartTimeout` period
289
+
- The bridge fails to establish communication within the `bridgeTimeout` period
290
+
252
291
## Environment-Specific Configurations
253
292
254
293
You can create different configurations for different environments:
0 commit comments