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

Unable to create new device when running parallel tests Jest #1004

Closed
Kattsallad opened this issue Oct 29, 2018 · 3 comments
Closed

Unable to create new device when running parallel tests Jest #1004

Kattsallad opened this issue Oct 29, 2018 · 3 comments

Comments

@Kattsallad
Copy link

Kattsallad commented Oct 29, 2018

Description

Running multiple workers with jest and xcode 10 seems to not work.
According to the documentation detox will create devices if they do not exist. This seems to fail.
Creating the device manually will work.

Steps to Reproduce

Have less devices available than worker count.
Run detox test with 2 workers "detox test -w 2"
My current setup is one device available and one needs to be created

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 9.0.5
  • React Native: 0.57.3
  • Node: 8.12.0
  • Device: Any iOS device (used in my tests "iPhone SE")
  • Xcode: 10.0.0 (10A255)
  • macOS: Latest mojave

Device and verbose Detox logs

detox test -c ios.sim.release -w 2 --loglevel trace
configuration="ios.sim.release" loglevel="trace" artifactsLocation="artifacts/ios.sim.release.2018-10-29 15-13-49Z" node_modules/.bin/jest e2e --config=e2e/jest.config.json --maxWorkers=2 '--testNamePattern=^((?!:android:).)*$'

 RUNS  e2e/signUpFlow.spec.js
 RUNS  e2e/devShake.spec.js

Test Suites: 0 of 2 total
Tests:       0 total
Snapshots:   0 total
Time:        0s, estimated 71s
████████████████████████████████████████detox[25054] INFO:  [DetoxServer.js] server listening on localhost:53062...
detox[25055] INFO:  [DetoxServer.js] server listening on localhost:53061...
detox[25054] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:53062
detox[25055] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:53061
detox[25054] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"39044f2f-2d0a-573d-b9b0-1ee758d3ef3a","role":"tester"},"messageId":0}
detox[25055] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"ba740f8c-0fc8-19bf-b6ce-0a844f4e3a62","role":"tester"},"messageId":0}
detox[25055] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=ba740f8c-0fc8-19bf-b6ce-0a844f4e3a62
detox[25054] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=39044f2f-2d0a-573d-b9b0-1ee758d3ef3a
detox[25055] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=ba740f8c-0fc8-19bf-b6ce-0a844f4e3a62
detox[25054] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=39044f2f-2d0a-573d-b9b0-1ee758d3ef3a
detox[25054] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"39044f2f-2d0a-573d-b9b0-1ee758d3ef3a","role":"tester"},"messageId":0}
 
detox[25055] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess" RUNS  e2e/signUpFlow.spec.js
 RUNS  e2e/devShake.spec.js

Test Suites: 0 of 2 total
Tests:       0 total
Snapshots:   0 total
Time:        1s, estimated 71s
████████████████████████████████████████detox[25055] TRACE: [exec.js/EXEC_SUCCESS, #0] [
  {
    "deviceType" : {
      "name" : "iPhone SE",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE"
    },
    "state" : "Booted",
    "availability" : "(available)",
    "name" : "iPhone SE",
    "udid" : "A0124012-281B-4BD8-9102-22BFCC425E1B",
    "os" : {
      "version" : "12.0",
      "availability" : "(available)",
      "name" : "iOS 12.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-0",
      "buildversion" : "16A366"
    }
  }
]

detox[25055] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byId "A0124012-281B-4BD8-9102-22BFCC425E1B"
detox[25054] DEBUG: [exec.js/EXEC_CMD, #0] applesimutils --list --byType "iPhone SE" --byOS "iOS 12.0"
detox[25054] DEBUG: [exec.js/EXEC_TRY, #0] Searching for device matching iPhone SE, iOS 12.0...
detox[25055] TRACE: [exec.js/EXEC_SUCCESS, #1] [
  {
    "deviceType" : {
      "name" : "iPhone SE",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE"
    },
    "state" : "Booted",
    "availability" : "(available)",
    "name" : "iPhone SE",
    "udid" : "A0124012-281B-4BD8-9102-22BFCC425E1B",
    "os" : {
      "version" : "12.0",
      "availability" : "(available)",
      "name" : "iOS 12.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-0",
      "buildversion" : "16A366"
    }
  }
]

detox[25055] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false,
  deviceId: 'A0124012-281B-4BD8-9102-22BFCC425E1B' })
detox[25054] TRACE: [exec.js/EXEC_SUCCESS, #0] [
  {
    "deviceType" : {
      "name" : "iPhone SE",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE"
    },
    "state" : "Booted",
    "availability" : "(available)",
    "name" : "iPhone SE",
    "udid" : "A0124012-281B-4BD8-9102-22BFCC425E1B",
    "os" : {
      "version" : "12.0",
      "availability" : "(available)",
      "name" : "iOS 12.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-0",
      "buildversion" : "16A366"
    }
  }
]

detox[25054] DEBUG: [exec.js/EXEC_CMD, #1] /usr/bin/xcrun simctl list -j
detox[25055] DEBUG: [exec.js/EXEC_CMD, #2] /usr/bin/xcrun simctl uninstall A0124012-281B-4BD8-9102-22BFCC425E1B se.XXX.app.dev
detox[25055] DEBUG: [exec.js/EXEC_TRY, #2] Uninstalling se.XXX.app.dev...
detox[25054] TRACE: [exec.js/EXEC_SUCCESS, #1] {
  "devicetypes" : [
    {
      "name" : "iPhone 4s",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-4s"
    },
    {
      "name" : "iPhone 5",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5"
    },
    {
      "name" : "iPhone 5s",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5s"
    },
    {
      "name" : "iPhone 6",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6"
    },
    {
      "name" : "iPhone 6 Plus",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus"
    },
    {
      "name" : "iPhone 6s",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s"
    },
    {
      "name" : "iPhone 6s Plus",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus"
    },
    {
      "name" : "iPhone 7",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7"
    },
    {
      "name" : "iPhone 7 Plus",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus"
    },
    {
      "name" : "iPhone 8",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8"
    },
    {
      "name" : "iPhone 8 Plus",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus"
    },
    {
      "name" : "iPhone SE",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE"
    },
    {
      "name" : "iPhone X",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-X"
    },
    {
      "name" : "iPhone XR",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-XR"
    },
    {
      "name" : "iPhone XS",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-XS"
    },
    {
      "name" : "iPhone XS Max",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-XS-Max"
    },
    {
      "name" : "iPad 2",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-2"
    },
    {
      "name" : "iPad Retina",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Retina"
    },
    {
      "name" : "iPad Air",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air"
    },
    {
      "name" : "iPad Air 2",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air-2"
    },
    {
      "name" : "iPad (5th generation)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-"
    },
    {
      "name" : "iPad Pro (9.7-inch)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-"
    },
    {
      "name" : "iPad Pro (12.9-inch)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro"
    },
    {
      "name" : "iPad Pro (12.9-inch) (2nd generation)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-"
    },
    {
      "name" : "iPad Pro (10.5-inch)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-"
    },
    {
      "name" : "iPad (6th generation)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad--6th-generation-"
    },
    {
      "name" : "Apple TV",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p"
    },
    {
      "name" : "Apple TV 4K",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K"
    },
    {
      "name" : "Apple TV 4K (at 1080p)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p"
    },
    {
      "name" : "Apple Watch - 38mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm"
    },
    {
      "name" : "Apple Watch - 42mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm"
    },
    {
      "name" : "Apple Watch Series 2 - 38mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm"
    },
    {
      "name" : "Apple Watch Series 2 - 42mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm"
    },
    {
      "name" : "Apple Watch Series 3 - 38mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm"
    },
    {
      "name" : "Apple Watch Series 3 - 42mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm"
    },
    {
      "name" : "Apple Watch Series 4 - 40mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-40mm"
    },
    {
      "name" : "Apple Watch Series 4 - 44mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-44mm"
    }
  ],
  "runtimes" : [
    {
      "buildversion" : "16A366",
      "availability" : "(available)",
      "name" : "iOS 12.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-0",
      "version" : "12.0"
    },
    {
      "buildversion" : "16J364",
      "availability" : "(available)",
      "name" : "tvOS 12.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-12-0",
      "version" : "12.0"
    },
    {
      "buildversion" : "16R363",
      "availability" : "(available)",
      "name" : "watchOS 5.0",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-5-0",
      "version" : "5.0"
    }
  ],
  "devices" : {
    "watchOS 5.0" : [
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 2 - 38mm",
        "udid" : "DE5BA572-F9CB-43AF-A685-E8B54E20E857"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 2 - 42mm",
        "udid" : "12F08146-1C99-404D-A82C-861FE3A491DC"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 3 - 38mm",
        "udid" : "7D46B034-EBA9-4882-AC0F-B406C17EB8BC"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 3 - 42mm",
        "udid" : "8D85C386-77AB-49D1-819E-60C4E603EE6B"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 4 - 40mm",
        "udid" : "77BEF4D0-F296-45DC-A3D1-ED3A39DBD570"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 4 - 44mm",
        "udid" : "D2FDC20B-1EC3-4AA2-9A2C-3A1CA7B76686"
      }
    ],
    "iOS 12.0" : [
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 5s",
        "udid" : "06BF96B1-A7BE-4CBA-98D7-A586CEA33DF4"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 6",
        "udid" : "DFBB29A0-8536-4FE4-A877-7D93D80D0C01"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 6 Plus",
        "udid" : "EAFDF44D-D2EB-4F95-A4CA-EE8CBE44278D"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 6s",
        "udid" : "E575E5D4-BB5A-4D2C-88D5-E30B87E20723"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 6s Plus",
        "udid" : "BE5C7F2F-429D-4E53-B0B0-1ED9BB9F7E39"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 7",
        "udid" : "D0183F47-100E-4B38-AACF-01095E433CCF"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 7 Plus",
        "udid" : "5849E206-6564-45DC-A548-1346A022510F"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 8",
        "udid" : "CDE794E4-AB6D-42B6-A05B-6FD684B3CFF1"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 8 Plus",
        "udid" : "CE3DC69E-78D8-4DC5-BC35-793A0E8B54CF"
      },
      {
        "state" : "Booted",
        "availability" : "(available)",
        "name" : "iPhone SE",
        "udid" : "A0124012-281B-4BD8-9102-22BFCC425E1B"
      },
      {
        "state" : "Booted",
        "availability" : "(available)",
        "name" : "iPhone X",
        "udid" : "010DBD76-3EF5-46C2-9367-2975F22980FA"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone XR",
        "udid" : "DC22D5BE-BF59-4991-BC1C-33FD238E3F7E"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone XS",
        "udid" : "AC0725C0-52E9-4342-8614-F82545D97684"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone XS Max",
        "udid" : "992DFA6D-EEAD-4FBD-879D-0F09AB6FD6E2"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Air",
        "udid" : "C91DDDA5-A5CF-46A8-9ED4-B002255932EB"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Air 2",
        "udid" : "231586A0-4CF0-4E84-98D2-05D249E3180A"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad (5th generation)",
        "udid" : "67D4F9AA-30C7-4552-9AB2-421F80667397"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Pro (9.7-inch)",
        "udid" : "A0BA047A-2FCD-4275-8C9D-2353A94FBE34"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Pro (12.9-inch)",
        "udid" : "E32D74CC-4EF5-4411-9A27-8D24E198241A"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Pro (12.9-inch) (2nd generation)",
        "udid" : "C98C7806-AD1E-458B-8676-6A73D0FA6D55"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Pro (10.5-inch)",
        "udid" : "3624DCA8-86E4-4D7E-9208-9876DA0F1B3B"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad (6th generation)",
        "udid" : "FC32AACE-E92A-4B5F-B461-C8449F998837"
      }
    ],
    "tvOS 12.0" : [
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple TV",
        "udid" : "4DA7F7CD-29B2-4419-BED3-F3B8A9BAD927"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple TV 4K",
        "udid" : "CA17B0CB-CB45-4A83-AFE6-24277ABDB99D"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple TV 4K (at 1080p)",
        "udid" : "BE73B537-A390-4E61-A9F5-88F4F887BBE5"
      }
    ]
  },
  "pairs" : {
    "4DC4559A-14A9-4923-A780-B32A6ACE992C" : {
      "watch" : {
        "name" : "Apple Watch Series 4 - 44mm",
        "udid" : "D2FDC20B-1EC3-4AA2-9A2C-3A1CA7B76686",
        "state" : "Shutdown"
      },
      "phone" : {
        "name" : "iPhone XS Max",
        "udid" : "992DFA6D-EEAD-4FBD-879D-0F09AB6FD6E2",
        "state" : "Shutdown"
      },
      "state" : "(active, disconnected)"
    },
    "D331DAB2-632A-47A1-A3BF-F4E022745A59" : {
      "watch" : {
        "name" : "Apple Watch Series 4 - 40mm",
        "udid" : "77BEF4D0-F296-45DC-A3D1-ED3A39DBD570",
        "state" : "Shutdown"
      },
      "phone" : {
        "name" : "iPhone XS",
        "udid" : "AC0725C0-52E9-4342-8614-F82545D97684",
        "state" : "Shutdown"
      },
      "state" : "(active, disconnected)"
    }
  }
}

detox[25054] ERROR: [index.js/DETOX_INIT_ERROR] 
 TypeError: Cannot read property 'identifier' of undefined
    at AppleSimUtils.create (/Users/robert/git/my-app/node_modules/detox/src/devices/ios/AppleSimUtils.js)
@stale
Copy link

stale bot commented Nov 28, 2018

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 Nov 28, 2018
@rotemmiz
Copy link
Member

Seems like the simctl output on Xcode 10 is what's expected by detox. Do you have the same issue with Xcode 9.x?

@stale stale bot removed the 🏚 stale label Nov 28, 2018
@Kattsallad
Copy link
Author

A reinstall of xcode seems to have fixed this issue. Tried with both xcode 9.x and 10.x and both seems to be working without a problem.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants