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

Detox stops running after 3rd test file #1107

Closed
ricbermo opened this issue Jan 2, 2019 · 4 comments
Closed

Detox stops running after 3rd test file #1107

ricbermo opened this issue Jan 2, 2019 · 4 comments

Comments

@ricbermo
Copy link

ricbermo commented Jan 2, 2019

Description

I'm not really sure about how to describe the issue since it's very weird, but I'll do my best to describe it here. Short: Detox stops/freezes after the 3rd test finishes running.

I have a list of 11 tests files, if I run the tests file by file using detox test -f e2e/myFile.test.js the tests pass. When I run detox tests to run them all, the process freezes/stop after the 3rd file is tests or testing the 4th one begins.

On every single file I have this:

beforeEach(async () => {
  await device.reloadReactNative();
  await helpers.login(false);
});

afterEach(async () => {
  await helpers.logout();
});

I created those helpers to avoi.d repeating code.

Steps to Reproduce

I'm not sure if I need steps here but:

  1. Create at least 4 tests files
  2. Run detox test

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 9.1.12
  • React Native: 50.57.7
  • Node: 11.0.0
  • Device: iPhoneX 12.1
  • Xcode: 10.0 (10B61)
  • macOS: Mojave 10.14.2

Device and verbose Detox logs

configuration="ios.sim.debug" loglevel="verbose" artifactsLocation="artifacts/ios.sim.debug.2019-01-02 17-58-18Z" node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:android:).)*$'
detox[44599] INFO:  [DetoxServer.js] server listening on localhost:64191...
detox[44599] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:64191
detox[44599] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=8fa2ce89-76b9-b550-c15b-52f3e8f4f4bb
detox[44599] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=8fa2ce89-76b9-b550-c15b-52f3e8f4f4bb
detox[44599] DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox[44599] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone X" --byOS "12.1"
detox[44599] DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone X...
detox[44599] DEBUG: [exec.js/EXEC_CMD, #2] applesimutils --list --byId "8CB29FFC-56BF-42EE-92B0-35ACB36C2808"
detox[44599] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl uninstall 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 com.lendingconnect.mobile
detox[44599] DEBUG: [exec.js/EXEC_TRY, #3] Uninstalling com.lendingconnect.mobile...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #3] com.lendingconnect.mobile uninstalled
detox[44599] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl install 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 "/Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app"
detox[44599] DEBUG: [exec.js/EXEC_TRY, #4] Installing /Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #4] /Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app installed
detox[44599] DEBUG: [exec.js/EXEC_CMD, #5] applesimutils --simulator 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 --bundle com.lendingconnect.mobile --setPermissions notifications=YES,camera=YES,medialibrary=YES,microphone=YES,photos=YES
detox[44599] DEBUG: [exec.js/EXEC_TRY, #5] Trying to set permissions...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #5] Permissions are set
detox[44599] DEBUG: [exec.js/EXEC_CMD, #6] /bin/cat /dev/null >/Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.out 2>/Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/ricbermo/Library/Detox/ios/aec62188116fcc095542b8295542435cd5c8a400/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 com.lendingconnect.mobile --args -detoxServer ws://localhost:64191 -detoxSessionId 8fa2ce89-76b9-b550-c15b-52f3e8f4f4bb
detox[44599] DEBUG: [exec.js/EXEC_TRY, #6] Launching com.lendingconnect.mobile...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #6] com.lendingconnect.mobile launched. The stdout and stderr logs were recreated, you can watch them with:
        tail -F /Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.{out,err}
detox[44599] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=8fa2ce89-76b9-b550-c15b-52f3e8f4f4bb)
detox[44599] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=8fa2ce89-76b9-b550-c15b-52f3e8f4f4bb
detox[44599] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=8fa2ce89-76b9-b550-c15b-52f3e8f4f4bb
 PASS  e2e/Contact.test.js (69.644s)
detox[44599] INFO:  [DetoxServer.js] server listening on localhost:64409...
detox[44599] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=8fa2ce89-76b9-b550-c15b-52f3e8f4f4bb
detox[44599] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:64409
detox[44599] DEBUG: [DetoxServer.js/DISCONNECT] role=testee, sessionId=8fa2ce89-76b9-b550-c15b-52f3e8f4f4bb
detox[44599] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=db1430e3-fa62-90f6-7751-59031eba2b0d
detox[44599] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=db1430e3-fa62-90f6-7751-59031eba2b0d
detox[44599] DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox[44599] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone X" --byOS "12.1"
detox[44599] DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone X...
detox[44599] DEBUG: [exec.js/EXEC_CMD, #2] applesimutils --list --byId "8CB29FFC-56BF-42EE-92B0-35ACB36C2808"
detox[44599] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl uninstall 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 com.lendingconnect.mobile
detox[44599] DEBUG: [exec.js/EXEC_TRY, #3] Uninstalling com.lendingconnect.mobile...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #3] com.lendingconnect.mobile uninstalled
detox[44599] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl install 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 "/Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app"
detox[44599] DEBUG: [exec.js/EXEC_TRY, #4] Installing /Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #4] /Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app installed
detox[44599] DEBUG: [exec.js/EXEC_CMD, #5] applesimutils --simulator 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 --bundle com.lendingconnect.mobile --setPermissions notifications=YES,camera=YES,medialibrary=YES,microphone=YES,photos=YES
detox[44599] DEBUG: [exec.js/EXEC_TRY, #5] Trying to set permissions...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #5] Permissions are set
detox[44599] DEBUG: [exec.js/EXEC_CMD, #6] /bin/cat /dev/null >/Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.out 2>/Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/ricbermo/Library/Detox/ios/aec62188116fcc095542b8295542435cd5c8a400/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 com.lendingconnect.mobile --args -detoxServer ws://localhost:64409 -detoxSessionId db1430e3-fa62-90f6-7751-59031eba2b0d
detox[44599] DEBUG: [exec.js/EXEC_TRY, #6] Launching com.lendingconnect.mobile...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #6] com.lendingconnect.mobile launched. The stdout and stderr logs were recreated, you can watch them with:
        tail -F /Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.{out,err}
detox[44599] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=db1430e3-fa62-90f6-7751-59031eba2b0d)
detox[44599] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=db1430e3-fa62-90f6-7751-59031eba2b0d
detox[44599] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=db1430e3-fa62-90f6-7751-59031eba2b0d
 PASS  e2e/LoanUploads.test.js (62.903s)
detox[44599] INFO:  [DetoxServer.js] server listening on localhost:64568...
detox[44599] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=db1430e3-fa62-90f6-7751-59031eba2b0d
detox[44599] DEBUG: [DetoxServer.js/DISCONNECT] role=testee, sessionId=db1430e3-fa62-90f6-7751-59031eba2b0d
detox[44599] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:64568
detox[44599] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=582c03d1-de9e-5b7d-fc7e-06b170513d99
detox[44599] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=582c03d1-de9e-5b7d-fc7e-06b170513d99
detox[44599] DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox[44599] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone X" --byOS "12.1"
detox[44599] DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone X...
detox[44599] DEBUG: [exec.js/EXEC_CMD, #2] applesimutils --list --byId "8CB29FFC-56BF-42EE-92B0-35ACB36C2808"
detox[44599] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl uninstall 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 com.lendingconnect.mobile
detox[44599] DEBUG: [exec.js/EXEC_TRY, #3] Uninstalling com.lendingconnect.mobile...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #3] com.lendingconnect.mobile uninstalled
detox[44599] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl install 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 "/Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app"
detox[44599] DEBUG: [exec.js/EXEC_TRY, #4] Installing /Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #4] /Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app installed
detox[44599] DEBUG: [exec.js/EXEC_CMD, #5] applesimutils --simulator 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 --bundle com.lendingconnect.mobile --setPermissions notifications=YES,camera=YES,medialibrary=YES,microphone=YES,photos=YES
detox[44599] DEBUG: [exec.js/EXEC_TRY, #5] Trying to set permissions...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #5] Permissions are set
detox[44599] DEBUG: [exec.js/EXEC_CMD, #6] /bin/cat /dev/null >/Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.out 2>/Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/ricbermo/Library/Detox/ios/aec62188116fcc095542b8295542435cd5c8a400/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 com.lendingconnect.mobile --args -detoxServer ws://localhost:64568 -detoxSessionId 582c03d1-de9e-5b7d-fc7e-06b170513d99
detox[44599] DEBUG: [exec.js/EXEC_TRY, #6] Launching com.lendingconnect.mobile...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #6] com.lendingconnect.mobile launched. The stdout and stderr logs were recreated, you can watch them with:
        tail -F /Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.{out,err}
detox[44599] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=582c03d1-de9e-5b7d-fc7e-06b170513d99)
detox[44599] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=582c03d1-de9e-5b7d-fc7e-06b170513d99
detox[44599] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=582c03d1-de9e-5b7d-fc7e-06b170513d99
 PASS  e2e/MyAccount.test.js (41.219s)
detox[44599] INFO:  [DetoxServer.js] server listening on localhost:64688...
detox[44599] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=582c03d1-de9e-5b7d-fc7e-06b170513d99
detox[44599] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:64688
detox[44599] DEBUG: [DetoxServer.js/DISCONNECT] role=testee, sessionId=582c03d1-de9e-5b7d-fc7e-06b170513d99
detox[44599] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=c478cde2-7189-aa54-3c38-73b5e0b1cd16
detox[44599] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=c478cde2-7189-aa54-3c38-73b5e0b1cd16
detox[44599] DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox[44599] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone X" --byOS "12.1"
detox[44599] DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone X...
detox[44599] DEBUG: [exec.js/EXEC_CMD, #2] applesimutils --list --byId "8CB29FFC-56BF-42EE-92B0-35ACB36C2808"
detox[44599] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl uninstall 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 com.lendingconnect.mobile
detox[44599] DEBUG: [exec.js/EXEC_TRY, #3] Uninstalling com.lendingconnect.mobile...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #3] com.lendingconnect.mobile uninstalled
detox[44599] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl install 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 "/Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app"
detox[44599] DEBUG: [exec.js/EXEC_TRY, #4] Installing /Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #4] /Users/ricbermo/development/LendingManagerHoldings/ios/build/Build/Products/Debug-iphonesimulator/LendingManagerHoldings.app installed
detox[44599] DEBUG: [exec.js/EXEC_CMD, #5] applesimutils --simulator 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 --bundle com.lendingconnect.mobile --setPermissions notifications=YES,camera=YES,medialibrary=YES,microphone=YES,photos=YES
detox[44599] DEBUG: [exec.js/EXEC_TRY, #5] Trying to set permissions...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #5] Permissions are set
detox[44599] DEBUG: [exec.js/EXEC_CMD, #6] /bin/cat /dev/null >/Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.out 2>/Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/ricbermo/Library/Detox/ios/aec62188116fcc095542b8295542435cd5c8a400/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 8CB29FFC-56BF-42EE-92B0-35ACB36C2808 com.lendingconnect.mobile --args -detoxServer ws://localhost:64688 -detoxSessionId c478cde2-7189-aa54-3c38-73b5e0b1cd16
detox[44599] DEBUG: [exec.js/EXEC_TRY, #6] Launching com.lendingconnect.mobile...
detox[44599] DEBUG: [exec.js/EXEC_SUCCESS, #6] com.lendingconnect.mobile launched. The stdout and stderr logs were recreated, you can watch them with:
        tail -F /Users/ricbermo/Library/Developer/CoreSimulator/Devices/8CB29FFC-56BF-42EE-92B0-35ACB36C2808/data/tmp/detox.last_launch_app_log.{out,err}
detox[44599] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=c478cde2-7189-aa54-3c38-73b5e0b1cd16)
detox[44599] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=c478cde2-7189-aa54-3c38-73b5e0b1cd16
detox[44599] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=c478cde2-7189-aa54-3c38-73b5e0b1cd16

 RUNS  e2e/LoanDetailsFlow.test.js

NOTE: I had to Ctrol+C since the process is frozen
@ricbermo ricbermo changed the title Detox stops running after 4th test file Detox stops running after 3rd test file Jan 2, 2019
@kasterlod
Copy link

@ricbermo did you found a solution? I have the same :|

@ricbermo
Copy link
Author

hey @kasterlod, how u doing? no, I didn't I had to create a custom script to run them all one by one. Here it is:

/* eslint no-console: 0 */
const glob = require('glob');
const {execSync} = require('child_process');

const baseCommand = 'detox test -f';

function run() {
  try {
    const files = glob.sync('**/e2e/*.test.js');
    const commands = files.map(path => `${baseCommand} ../${path}`);
    commands.forEach(c => {
      console.log('=======================');
      console.log(`Running ${c}`);
      execSync(c);
      console.log('=======================');
    });
  } catch (e) {
    console.log(e);
  }
}
run();```

Notice I'm using node glob.

@stale
Copy link

stale bot commented Mar 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.

@stale stale bot added the 🏚 stale label Mar 1, 2019
@stale
Copy link

stale bot commented Mar 8, 2019

The issue has been closed for inactivity.

@stale stale bot closed this as completed Mar 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants