Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite synchronization and test-exec troubleshooting guides #4735

Merged
merged 2 commits into from
Mar 23, 2025

Conversation

d4vidi
Copy link
Collaborator

@d4vidi d4vidi commented Mar 11, 2025

Description

In this pull request, I have rewritten the synchronization troubleshooting guide, in the sense of making it more practical, up to date (with knowledge+insights we've gathered) and thorough in terms of debugging and bug-fixing possibilities.

I've also extended the detox debugging guide such that it would explain how to utilize --inspect-brk using Webstorm.

cc @Kerzman


For features/enhancements:

  • I have added/updated the relevant references in the documentation files.

For API changes:

  • I have made the necessary changes in the types index file.

Sorry, something went wrong.

@d4vidi d4vidi requested a review from noomorph March 11, 2025 19:26
@d4vidi d4vidi marked this pull request as ready for review March 12, 2025 15:24
@d4vidi d4vidi changed the title Rewrite synchronization troubleshooting guide Rewrite synchronization and test-exec troubleshooting guide Mar 13, 2025
@d4vidi d4vidi changed the title Rewrite synchronization and test-exec troubleshooting guide Rewrite synchronization and test-exec troubleshooting guides Mar 13, 2025
@d4vidi d4vidi force-pushed the docs/sync-troublshoot-and-dbg branch 2 times, most recently from df74dac to 8be4648 Compare March 16, 2025 08:53
@d4vidi d4vidi force-pushed the docs/sync-troublshoot-and-dbg branch from 8be4648 to d4f8289 Compare March 16, 2025 08:54
Copy link
Collaborator

@noomorph noomorph left a comment

Choose a reason for hiding this comment

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

Great and very neccessary work, Amit! Thanks for putting effort into this. I liked very much your idea with tracking some long-standing TODO issues in the docs. This will help users to monitor the status of some requested features. Very good!


## How Detox Automatically Synchronizes With Your App

One of the key features of Detox is its ability to automatically synchronize the test execution with your app. The most annoying aspect of end-to-end tests is flakiness—tests sometimes fail without anything changing. Flakiness happens because tests are nondeterministic. Every time a test is running, things take place in a slightly different order inside your app.
One of the key features of Detox is its ability to automatically synchronize the test execution with your app. The most annoying aspect of end-to-end tests is flakiness—tests sometimes fail without anything changing. Flakiness happens because tests are nondeterministic. Every time a test is running, things take place in a slightly different order or execution-time inside your app.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
One of the key features of Detox is its ability to automatically synchronize the test execution with your app. The most annoying aspect of end-to-end tests is flakiness—tests sometimes fail without anything changing. Flakiness happens because tests are nondeterministic. Every time a test is running, things take place in a slightly different order or execution-time inside your app.
One of the key features of Detox is its ability to synchronize test execution with the app’s state, reducing instability caused by timing uncertainties. One of the biggest challenges in end-to-end testing is knowing exactly when the app is in a reliable state for assertions. Instability can arise due to asynchronous operations completing in different orders, depending on factors like system load, network conditions, and execution timing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've completely rephrased this section. Will push soon.


Detox tries to eliminate flakiness by automatically synchronizing your tests with the app. A test cannot continue to the next command until the app becomes idle. Detox monitors your app very closely in order to know when it’s idle. It tracks several asynchronous operations and waits until they complete. This includes:
Detox tries to eliminate flakiness by automatically synchronizing your tests with the app. A test cannot continue to the next command until the app becomes idle. Detox monitors your app very closely in order to know when it’s idle. It tracks several asynchronous operations and waits until they complete.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Detox tries to eliminate flakiness by automatically synchronizing your tests with the app. A test cannot continue to the next command until the app becomes idle. Detox monitors your app very closely in order to know when it’s idle. It tracks several asynchronous operations and waits until they complete.
Detox reduces timing-related instability by dynamically synchronizing tests with the app’s actual execution state. Instead of relying on fixed delays or polling, Detox detects when the app is truly idle, ensuring actions and assertions happen at the right time. This synchronization not only improves reliability but can also **speed up test execution**, as it prevents unnecessary waiting. Detox tracks several key asynchronous operations to determine when the app is in a ready state.

@d4vidi d4vidi force-pushed the docs/sync-troublshoot-and-dbg branch from 3c735ab to 590b0fb Compare March 21, 2025 16:46
@d4vidi
Copy link
Collaborator Author

d4vidi commented Mar 21, 2025

@noomorph please have an additional glance over the latest commit

@d4vidi d4vidi enabled auto-merge (squash) March 21, 2025 17:04
@d4vidi d4vidi disabled auto-merge March 23, 2025 09:36
@d4vidi d4vidi merged commit e14bb69 into master Mar 23, 2025
4 of 5 checks passed
@d4vidi d4vidi deleted the docs/sync-troublshoot-and-dbg branch March 23, 2025 09:36
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.

None yet

2 participants