Detox tests timing out after setting up Performance Monitoring
See original GitHub issueEnvironment
How do you use Sentry? sentry.io
Which SDK and version?
"@sentry/react-native": "^3.1.1"
Steps to Reproduce
- Following instructions for Performance Monitoring
- Run tests on debug/release
App
function App() {
return (
<Provider store={store}>
<ProviderApp />
</Provider>
);
}
export default wrap(App);
Config
export const ReactNavigationInstrumentation = new Sentry.ReactNavigationInstrumentation({
routeChangeTimeoutMs: 20000,
});
if (!disableSentry) {
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.ENV,
enableNative: process.env.JEST || disableSentry ? false : true,
autoSessionTracking: true,
enableAutoSessionTracking: true,
sessionTrackingIntervalMillis: 10000,
integrations: [
new Sentry.ReactNativeTracing({
idleTimeout: 5000,
routingInstrumentation: ReactNavigationInstrumentation,
tracingOrigins: ['localhost', /^\//, /^https:\/\//],
}),
],
tracesSampleRate: 0.2, // maybe set this to 100% if __DEV__
});
}
Expected Result
Tests should pass.
Actual Result
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] WARN: [PENDING_REQUESTS] The app has not responded to the network requests below:
(id = 80) invoke: {"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAssertion"},"method":"assertMatcher","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"androidx.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["email-signin-input"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForSufficientlyVisible","args":[]}}]}
That might be the reason why the test "My Apps Tests Test using common interface" has timed out.
detox[36483] INFO: My Apps Tests: Test using common interface [FAIL]
detox[36483] INFO: [APP_STATUS] App synchronization debug:
The app is busy, due to:
- Enqueued timers
detox[36483] ERROR: [Client.js/ERROR] The pending request #-49642 ("cleanup") has been rejected due to the following error:
The tester has not received a response within 5000ms timeout to the message:
Cleanup {
type: 'cleanup',
params: [Object],
messageId: -49642
}
FAIL __tests__/e2e/tests/NavBarTest.tv.e2e.ts (400.848 s)
Tests work if the config is commented out
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Dealing With Synchronization Issues in Tests | Detox
We are waiting too much - The test will appear to hang and fail with timeout. This happens because Detox thinks an asynchronous...
Read more >Detox: Writing Stable Test Suites | Wix Engineering - Medium
Issue: Tests hang and time out Detox manages sync between the app and test code, and waits for the app to go idle....
Read more >React Native end-to-end testing with Detox - LogRocket Blog
Demo running end-to-end tests in React Native with Detox, an end-to-end framework for mobile apps developed by Wix.
Read more >Detox: The unobtainable test stability (or is it?) [Breakpoint 2021]
Rotem will be talking about Detox —a gray box testing solution for mobile apps, how they fight flakiness, best practices, and their strife ......
Read more >React Native E2E UI testing with Detox and Bitrise
Inside your React Native project folder, install Detox with the ... Now it's time to build and test our React Native apps with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@marandaneto This is still happening. I just spent a couple days tracking down what was causing our Detox tests to hang. After removing react native tracing instrumentation, our tests now pass successfully. I was able to track down that the timers are being set in the stall tracking: https://github.com/getsentry/sentry-react-native/blob/main/src/js/tracing/stalltracking.ts
I’d be happy to work on a PR with a bit of assistance. For now my solution is detect when it is an e2e test run and not include tracing instrumentation in my integrations.
I had the same issue. This is because performance tracing sets up a timer mechanism to measure the users behaviour, which breaks the sync mechanism of detox.
What helped me was to conditionally disable the tracing integration on JS side like this:
I think this is the right solution as you typically would not want tracing in your e2e tests or dev build.