-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Unable to control >1 simulator when running parallel Jest tests #1320
Comments
@cs01, could you please remake the logs, but in log level trace mode? Thanks in advance |
And why do you remove the lock file? Not sure if I understood your reasoning behind that. |
Thank you for the quick response! I will post trace logs soon.
To ensure consistent simulator state between runs and avoid creating new simulators, as found by trial and error and then later in the detox documentation. |
So, you don't use Detox CLI. Okay. |
I don't use the global setup but I do add It is interesting that the init and cleanup calls are done back-to-back in the |
Hey @cs01, there's a lot of data missing here, what is the exact command params you run Try running the |
I am running Jest with the following arguments:
I am passing the following config to Detox:
I am not setting any environment variables. I tried comparing the trace output of |
It was a surprise to me too, but the idea is to install the app in Lines 80 to 98 in 789ded5
Detox/detox/src/devices/drivers/SimulatorDriver.js Lines 30 to 33 in 6c73108
|
@cs01, as for your issue, I have a hunch that one of the workers hangs up waiting for a free device. Please try doing it yourself — I hope it is going to be fruitful and helps to locate the exact place where your code gets stuck. Afterward, we could arrange a PR that extends logging a bit, to help other people using Detox that hit the same situation you are (were) in. |
I have definitely already looked around the detox source and learned a lot about it 😄 . Turned out I was running my test in a config with several other Jest projects. By making my own config and calling it directly (not along with other projects), the workers didn't freeze up. |
Chad, please, let's do post mortem. Any wild ideas that could have helped people in your shoes to figure out they are doing something terribly wrong? :) I'd be happy to improve user-friendliness in some places for sure. How did the project structure look like, in general? |
This issue has been automatically closed because there has been no response to our request for more information from the original author. |
Detox: 12.4.0
Node: v8.11.1
device: iPhone 7 Plus
Xcode: 10.2
macOS: Mojave 10.14.4
jest: 24.7.1
This issue is similar to #1004. When running Jest in our build system (not via detox cli) with 2 workers and 2 tests, only one simulator starts and runs. The other never starts, and the test times out.
Only one simulator starts
This is an invocation of Jest in our source tree where only one simulator starts despite having two Jest workers. You can see both tests are run in parallel, and the Detox server is started for both (so detox.init() was called in
beforeAll()
for both), but things just seem to stop when the simulator call is supposed to occur, almost like the first worker gets a mutex onxcrun
.I manually remove
~/Library/Detox/device.registry.state.lock
at the start of the test and call Jest.successful run of
demo-react-native-jest
This is a successful run of the Detox example. You can see the two simulators get started in parallel.
The text was updated successfully, but these errors were encountered: