title: Detox UI Testing - Tests time out when running on CI
body: <p>I'm running react-native android integration tests headlessly using the detox framework on Ubuntu 18.04.</p>
  
  <p>The line that I use to run my test suite as a whole is: 
  <code>detox test -c android.emu.ci --headless --cleanup --take-screenshots failing --detectOpenHandles</code>. This runs 7 tests.</p>
  
  <p>When I run the tests like this the first test runs successfully, and then the second test fails, as it seems like the <a href="https://gist.github.com/juddey/b94ccd9b721273d839e302087edb7f06#file-trace-txt-L586" rel="nofollow noreferrer">emulator is offline</a>.</p>
  
  <p>If I run the tests individually with a 15 second gap between them eg:</p>
  
  <pre><code>    - detox test post.spec.js -c android.emu.ci --headless --cleanup --take-screenshots failing --detectOpenHandles
      - sleep 15s
      - detox test post.report.spec.js -c android.emu.ci --headless --cleanup --take-screenshots failing --detectOpenHandles
      - sleep 15s
  </code></pre>
  
  <p>They all complete without failing, so the tests are not the culprit.</p>
  
  <p>I have tried adding a sleep in the afterEach for each test, and as the last action in each test, but neither of these have been successful.</p>
  
  <p>I'm looking for suggestions/direction on what to do to get the tests to wait for the emulator to be ready before executing.</p>