Detox icon indicating copy to clipboard operation
Detox copied to clipboard

Failed to cleanup the device allocation driver for ios.simulator after a failed initialization

Open Vadko opened this issue 3 months ago • 5 comments

What happened?

We are constantly getting this error when running e2e tests on self-hosted CI machines via github:

Failed to cleanup the device allocation driver for ios.simulator after a failed initialization

Usually, it appears if we have several shards (4-7), and almost half of them are failing before tests have started with this error.

What was the expected behaviour?

No response

Was it tested on latest Detox?

  • [X] I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.18.1 React Native version: 0.73.4 Has Fabric (React Native's new rendering system) enabled: no Node version: 18.18.0 / 20.8.0 Device model: iPhone simulator iOS version: 15.5 macOS version: 13.4 Xcode version: 14.3.1 Test-runner (select one): jest

Detox logs

Detox logs
15:05:01.481 detox[92671] B lifecycle node_modules/.bin/detox test -c ios.sim.release --colors --cleanup --maxWorkers 2 --loglevel trace --record-logs all --take-screenshots failing --record-videos failing --artifacts-location ./detox_artifacts/ e2e/tests/healthcheck/ e2e/tests-new/healthcheck/
  data: {
    "id": "4c7a5331-ac50-2dc6-f45a-dca8ea8be3e6",
    "detoxConfig": {
      "configurationName": "ios.sim.release",
      "apps": {
        "default": {
          "type": "ios.app",
          "binaryPath": "./ios/build/Build/Products/Release-iphonesimulator/***.app",
          "build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/***.xcworkspace -scheme *** -configuration Release -sdk iphonesimulator -derivedDataPath ios/build"
        }
      },
      "artifacts": {
        "rootDir": "./detox_artifacts",
        "plugins": {
          "log": {
            "enabled": true,
            "keepOnlyFailedTestsArtifacts": false
          },
          "screenshot": {
            "enabled": true,
            "shouldTakeAutomaticSnapshots": true,
            "keepOnlyFailedTestsArtifacts": true,
            "takeWhen": {
              "testStart": false,
              "testDone": false
            }
          },
          "video": {
            "enabled": true,
            "keepOnlyFailedTestsArtifacts": true
          },
          "instruments": {
            "enabled": false,
            "keepOnlyFailedTestsArtifacts": false
          },
          "uiHierarchy": {
            "enabled": false,
            "keepOnlyFailedTestsArtifacts": false
          }
        }
      },
      "behavior": {
        "init": {
          "keepLockFile": false,
          "reinstallApp": true,
          "exposeGlobals": true
        },
        "cleanup": {
          "shutdownDevice": true
        },
        "launchApp": "auto"
      },
      "cli": {
        "artifactsLocation": "./detox_artifacts/",
        "recordLogs": "all",
        "takeScreenshots": "failing",
        "recordVideos": "failing",
        "cleanup": true,
        "configuration": "ios.sim.release",
        "loglevel": "trace",
        "start": true
      },
      "device": {
        "type": "ios.simulator",
        "device": {
          "type": "iPhone 11"
        }
      },
      "logger": {
        "level": "trace",
        "overrideConsole": true,
        "options": {
          "showLoggerName": true,
          "showPid": true,
          "showLevel": false,
          "showMetadata": false,
          "basepath": "/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src",
          "prefixers": {},
          "stringifiers": {}
        }
      },
      "testRunner": {
        "retries": 0,
        "forwardEnv": true,
        "detached": false,
        "bail": false,
        "jest": {
          "setupTimeout": 300000,
          "teardownTimeout": 30000,
          "retryAfterCircusRetries": false,
          "reportSpecs": true,
          "reportWorkerAssign": true
        },
        "args": {
          "$0": "jest",
          "_": [
            "e2e/tests/healthcheck/",
            "e2e/tests-new/healthcheck/"
          ],
          "config": "e2e/jest.config.js",
          "no-cache": true,
          "colors": true,
          "maxWorkers": 2,
          "--": []
        },
        "$0": "jest"
      },
      "session": {
        "autoStart": true,
        "debugSynchronization": 10000
      }
    },
    "detoxIPCServer": "primary-92671",
    "testResults": [],
    "testSessionIndex": 0,
    "workersCount": 0
  }
15:05:01.489 detox[92671] i ipc Server path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + ipc.config.id /tmp/detox.primary-92671
15:05:01.490 detox[92671] i ipc starting server on  /tmp/detox.primary-92671 
15:05:01.490 detox[92671] i ipc starting TLS server false
15:05:01.491 detox[92671] i ipc starting server as Unix || Windows Socket
15:05:01.492 detox[92671] i ws-server Detox server listening on localhost:56526...
15:05:01.496 detox[92671] i lifecycle Serialized the session state at: /private/var/folders/03/t49rxpfs0xb9vdyzt9184x1r0000gn/T/4c7a5331-ac50-2dc6-f45a-dca8ea8be3e6.detox.json
15:05:01.501 detox[92671] B lifecycle DETOX_ARTIFACTS_LOCATION="./detox_artifacts/" DETOX_CLEANUP=true DETOX_CONFIGURATION="ios.sim.release" DETOX_LOGLEVEL="trace" DETOX_RECORD_LOGS="all" DETOX_RECORD_VIDEOS="failing" DETOX_TAKE_SCREENSHOTS="failing" jest --config e2e/jest.config.js --no-cache --colors --maxWorkers 2 e2e/tests/healthcheck/ e2e/tests-new/healthcheck/
--- START LOG ALL TESTS THAT WILL RUN ---

pt/actions-runner/_work/***/***/projects/app/e2e/tests/healthcheck/healthcheckAuth.test.ts pt/actions-runner/_work/***/***/projects/app/e2e/tests/healthcheck/healthcheckDefineUser.test.ts pt/actions-runner/_work/***/***/projects/app/e2e/tests/healthcheck/healthcheckInvalidToken.test.ts pt/actions-runner/_work/***/***/projects/app/e2e/tests/healthcheck/healthcheckNavigation.test.ts pt/actions-runner/_work/***/***/projects/app/e2e/tests/healthcheck/healthcheckNativeSecurityToken.test.ts

--- END LOG ALL TESTS THAT WILL RUN ---

Found 5 test suites
14:05:02.761 detox[92706] B lifecycle e2e/tests/healthcheck/healthcheckAuth.test.ts
14:05:02.761 detox[92707] B lifecycle e2e/tests/healthcheck/healthcheckDefineUser.test.ts
14:05:02.779 detox[92707] B lifecycle set up environment
14:05:02.780 detox[92706] B lifecycle set up environment
14:05:02.783 detox[92707] i ipc Service path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + id 
14:05:02.783 detox[92706] i ipc Service path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + id 
14:05:02.783 detox[92707] i ipc requested connection to  primary-92671 /tmp/detox.primary-92671
14:05:02.783 detox[92707] i ipc Connecting client on Unix Socket : /tmp/detox.primary-92671
14:05:02.783 detox[92706] i ipc requested connection to  primary-92671 /tmp/detox.primary-92671
14:05:02.783 detox[92706] i ipc Connecting client on Unix Socket : /tmp/detox.primary-92671
15:05:02.784 detox[92671] i ipc ## socket connection to server detected ##
15:05:02.785 detox[92671] i ipc ## socket connection to server detected ##
14:05:02.786 detox[92706] i ipc retrying reset
14:05:02.786 detox[92707] i ipc retrying reset
14:05:02.787 detox[92706] i ipc dispatching event to  primary-92671 /tmp/detox.primary-92671  :  registerContext , { id: 'secondary-92706' }
14:05:02.787 detox[92707] i ipc dispatching event to  primary-92671 /tmp/detox.primary-92671  :  registerContext , { id: 'secondary-92707' }
15:05:02.788 detox[92671] i ipc received event of :  registerContext { id: 'secondary-92706' }
15:05:02.789 detox[92671] i ipc dispatching event to socket  :  registerContextDone {
  testResults: [],
  testSessionIndex: 0,
  unsafe_earlyTeardown: undefined
}
15:05:02.789 detox[92671] i ipc received event of :  registerContext { id: 'secondary-92707' }
15:05:02.789 detox[92671] i ipc dispatching event to socket  :  registerContextDone {
  testResults: [],
  testSessionIndex: 0,
  unsafe_earlyTeardown: undefined
}
14:05:02.789 detox[92706] i ipc ## received events ##
14:05:02.790 detox[92706] i ipc detected event registerContextDone { testResults: [], testSessionIndex: 0 }
14:05:02.790 detox[92707] i ipc ## received events ##
14:05:02.790 detox[92706] i ipc dispatching event to  primary-92671 /tmp/detox.primary-92671  :  registerWorker , { workerId: 'w1' }
14:05:02.790 detox[92707] i ipc detected event registerContextDone { testResults: [], testSessionIndex: 0 }
15:05:02.791 detox[92671] i ipc received event of :  registerWorker { workerId: 'w1' }
15:05:02.791 detox[92671] i ipc dispatching event to socket  :  registerWorkerDone { workersCount: 1 }
14:05:02.791 detox[92707] i ipc dispatching event to  primary-92671 /tmp/detox.primary-92671  :  registerWorker , { workerId: 'w2' }
15:05:02.791 detox[92671] i ipc broadcasting event to all known sockets listening to  /tmp/detox.primary-92671  :   sessionStateUpdate { workersCount: 1 }
14:05:02.791 detox[92706] i ipc ## received events ##
15:05:02.791 detox[92671] i ipc received event of :  registerWorker { workerId: 'w2' }
15:05:02.791 detox[92671] i ipc dispatching event to socket  :  registerWorkerDone { workersCount: 2 }
14:05:02.791 detox[92706] i ipc detected event registerWorkerDone { workersCount: 1 }
15:05:02.791 detox[92671] i ipc broadcasting event to all known sockets listening to  /tmp/detox.primary-92671  :   sessionStateUpdate { workersCount: 2 }
14:05:02.791 detox[92707] i ipc ## received events ##
14:05:02.791 detox[92707] i ipc detected event sessionStateUpdate { workersCount: 1 }
14:05:02.792 detox[92707] i ipc ## received events ##
14:05:02.792 detox[92707] i ipc detected event registerWorkerDone { workersCount: 2 }
14:05:02.792 detox[92707] i ipc detected event sessionStateUpdate { workersCount: 2 }
14:05:02.885 detox[92706] i ipc ## received events ##
14:05:02.885 detox[92706] i ipc detected event sessionStateUpdate { workersCount: 1 }
14:05:02.885 detox[92706] i ipc detected event sessionStateUpdate { workersCount: 2 }
15:05:02.889 detox[92671] B ws-server@56527 connection :56526<->:56527
15:05:02.889 detox[92671] B ws-server@56528 connection :56526<->:56528
14:05:02.889 detox[92706] i ws-client opened web socket to: ws://localhost:56526
14:05:02.890 detox[92707] i ws-client opened web socket to: ws://localhost:56526
14:05:02.891 detox[92706] i ws-client send message
  data: {"type":"login","params":{"sessionId":"1815fec5-2131-976f-ef06-50a590b435fc","role":"tester"},"messageId":0}
15:05:02.892 detox[92671] i ws-server@56527 get
  data: {"type":"login","params":{"sessionId":"1815fec5-2131-976f-ef06-50a590b435fc","role":"tester"},"messageId":0}
14:05:02.892 detox[92707] i ws-client send message
  data: {"type":"login","params":{"sessionId":"6f5b82fe-3926-6600-1c3c-0124618dd3ec","role":"tester"},"messageId":0}
15:05:02.892 detox[92671] i ws-server created session 1815fec5-2131-976f-ef06-50a590b435fc
15:05:02.892 detox[92671] i ws-server@56527 send
  data: {
    "type": "loginSuccess",
    "params": {
      "testerConnected": true,
      "appConnected": false
    },
    "messageId": 0
  }
15:05:02.892 detox[92671] i ws-server tester joined session 1815fec5-2131-976f-ef06-50a590b435fc
15:05:02.893 detox[92671] i ws-server@56528 get
  data: {"type":"login","params":{"sessionId":"6f5b82fe-3926-6600-1c3c-0124618dd3ec","role":"tester"},"messageId":0}
15:05:02.893 detox[92671] i ws-server created session 6f5b82fe-3926-6600-1c3c-0124618dd3ec
15:05:02.893 detox[92671] i ws-server@56528 send
  data: {
    "type": "loginSuccess",
    "params": {
      "testerConnected": true,
      "appConnected": false
    },
    "messageId": 0
  }
15:05:02.893 detox[92671] i ws-server tester joined session 6f5b82fe-3926-6600-1c3c-0124618dd3ec
14:05:02.893 detox[92706] i ws-client get message
  data: {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0}
   
14:05:02.893 detox[92707] i ws-client get message
  data: {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0}
   
14:05:03.859 detox[92706] i ipc dispatching event to  primary-92671 /tmp/detox.primary-92671  :  allocateDevice , {
  deviceConfig: { type: 'ios.simulator', device: { type: 'iPhone 11' } }
}
14:05:03.859 detox[92707] i ipc dispatching event to  primary-92671 /tmp/detox.primary-92671  :  allocateDevice , {
  deviceConfig: { type: 'ios.simulator', device: { type: 'iPhone 11' } }
}
15:05:03.859 detox[92671] i ipc received event of :  allocateDevice {
  deviceConfig: { type: 'ios.simulator', device: { type: 'iPhone 11' } }
}
15:05:03.869 detox[92671] B device init
  args: ()
15:05:03.883 detox[92671] E device init
  error: SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:[17](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:18))
      at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)
      at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)
      at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:1[18](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:19):31
      at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DeviceRegistry.unregisterZombieDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:117:5)
      at async SimulatorAllocDriver.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:32:5)
      at async DeviceAllocator.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceAllocator.js:26:7)
15:05:03.883 detox[92671] B device cleanup
  args: ()
15:05:03.884 detox[92671] E device cleanup
  error: SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)
      at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)
      at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)
      at DeviceRegistry._getSessionDevicesSync (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:183:26)
      at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:136:22
      at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DeviceRegistry.readSessionDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:135:5)
      at async SimulatorAllocDriver.cleanup (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:90:30)
15:05:03.884 detox[92671] i device Failed to cleanup the device allocation driver for ios.simulator after a failed initialization
  error: SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)
      at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)
      at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)
      at DeviceRegistry._getSessionDevicesSync (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:183:26)
      at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:136:22
      at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DeviceRegistry.readSessionDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:135:5)
      at async SimulatorAllocDriver.cleanup (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:90:30)
15:05:03.884 detox[92671] i ipc dispatching event to socket  :  allocateDeviceDone {
  error: {
    name: 'SyntaxError',
    message: 'Unexpected end of JSON input',
    stack: 'SyntaxError: Unexpected end of JSON input\n' +
      '    at JSON.parse (<anonymous>)\n' +
      '    at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)\n' +
      '    at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)\n' +
      '    at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)\n' +
      '    at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:118:31\n' +
      '    at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)\n' +
      '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
      '    at async DeviceRegistry.unregisterZombieDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:117:5)\n' +
      '    at async SimulatorAllocDriver.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:32:5)\n' +
      '    at async DeviceAllocator.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceAllocator.js:26:7)'
  }
}
15:05:03.884 detox[92671] i ipc received event of :  allocateDevice {
  deviceConfig: { type: 'ios.simulator', device: { type: 'iPhone 11' } }
}
15:05:03.885 detox[92671] B device init
  args: ()
14:05:03.884 detox[92707] i ipc ## received events ##
15:05:03.885 detox[92671] E device init
  error: SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)
      at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)
      at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)
      at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:118:31
      at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DeviceRegistry.unregisterZombieDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:117:5)
      at async SimulatorAllocDriver.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:32:5)
      at async DeviceAllocator.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceAllocator.js:26:7)
15:05:03.885 detox[92671] B device cleanup
  args: ()
14:05:03.885 detox[92707] i ipc detected event allocateDeviceDone {
  error: {
    name: 'SyntaxError',
    message: 'Unexpected end of JSON input',
    stack: 'SyntaxError: Unexpected end of JSON input\n' +
      '    at JSON.parse (<anonymous>)\n' +
      '    at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)\n' +
      '    at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)\n' +
      '    at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)\n' +
      '    at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:118:31\n' +
      '    at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)\n' +
      '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
      '    at async DeviceRegistry.unregisterZombieDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:117:5)\n' +
      '    at async SimulatorAllocDriver.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:32:5)\n' +
      '    at async DeviceAllocator.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceAllocator.js:26:7)'
  }
}
15:05:03.885 detox[92671] E device cleanup
  error: SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)
      at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)
      at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)
      at DeviceRegistry._getSessionDevicesSync (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:183:26)
      at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:136:22
      at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DeviceRegistry.readSessionDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:135:5)
      at async SimulatorAllocDriver.cleanup (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:90:30)
15:05:03.885 detox[92671] i device Failed to cleanup the device allocation driver for ios.simulator after a failed initialization
  error: SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)
      at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)
      at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)
      at DeviceRegistry._getSessionDevicesSync (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:183:26)
      at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:136:22
      at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DeviceRegistry.readSessionDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:135:5)
      at async SimulatorAllocDriver.cleanup (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:90:30)
15:05:03.886 detox[92671] i ipc dispatching event to socket  :  allocateDeviceDone {
  error: {
    name: 'SyntaxError',
    message: 'Unexpected end of JSON input',
    stack: 'SyntaxError: Unexpected end of JSON input\n' +
      '    at JSON.parse (<anonymous>)\n' +
      '    at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)\n' +
      '    at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)\n' +
      '    at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)\n' +
      '    at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:118:31\n' +
      '    at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)\n' +
      '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
      '    at async DeviceRegistry.unregisterZombieDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:117:5)\n' +
      '    at async SimulatorAllocDriver.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:32:5)\n' +
      '    at async DeviceAllocator.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceAllocator.js:26:7)'
  }
}
14:05:03.885 detox[92707] E lifecycle set up environment
  error: SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)
      at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)
      at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)
      at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:118:31
      at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:[21](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:22))
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DeviceRegistry.unregisterZombieDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:117:5)
      at async SimulatorAllocDriver.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:32:5)
      at async DeviceAllocator.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceAllocator.js:26:7)
14:05:03.886 detox[92707] B lifecycle tear down environment
14:05:03.886 detox[92706] i ipc ## received events ##
14:05:03.886 detox[92706] i ipc detected event allocateDeviceDone {
  error: {
    name: 'SyntaxError',
    message: 'Unexpected end of JSON input',
    stack: 'SyntaxError: Unexpected end of JSON input\n' +
      '    at JSON.parse (<anonymous>)\n' +
      '    at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)\n' +
      '    at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)\n' +
      '    at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)\n' +
      '    at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:118:31\n' +
      '    at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)\n' +
      '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
      '    at async DeviceRegistry.unregisterZombieDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:117:5)\n' +
      '    at async SimulatorAllocDriver.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:32:5)\n' +
      '    at async DeviceAllocator.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceAllocator.js:26:7)'
  }
}
14:05:03.886 detox[92707] B artifacts-manager onBeforeCleanup
  args: ()
14:05:03.887 detox[92706] E lifecycle set up environment
  error: SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at ExclusiveLockfile._doRead (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:90:17)
      at ExclusiveLockfile.read (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:56:26)
      at DeviceRegistry._getRegisteredDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:178:36)
      at /opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:118:31
      at ExclusiveLockfile.exclusively (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/utils/ExclusiveLockfile.js:41:21)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DeviceRegistry.unregisterZombieDevices (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceRegistry.js:117:5)
      at async SimulatorAllocDriver.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js:32:5)
      at async DeviceAllocator.init (/opt/actions-runner/_work/***/***/projects/app/node_modules/detox/src/devices/allocation/DeviceAllocator.js:26:7)
14:05:03.887 detox[92706] B lifecycle tear down environment
14:05:03.887 detox[92706] B artifacts-manager onBeforeCleanup
  args: ()
14:05:03.888 detox[92707] i artifact:ARTIFACT_SAVE saving FileArtifact to: detox_artifacts/detox_pid_92707.json.log { append: true }
14:05:03.889 detox[92707] i artifact:ARTIFACT_SAVE saving FileArtifact to: detox_artifacts/detox_pid_92707.log { append: true }
14:05:03.889 detox[92707] E artifacts-manager onBeforeCleanup
14:05:03.890 detox[92706] i artifact:ARTIFACT_SAVE saving FileArtifact to: detox_artifacts/detox_pid_92706.json.log { append: true }
14:05:03.890 detox[92706] i artifact:ARTIFACT_SAVE saving FileArtifact to: detox_artifacts/detox_pid_92706.log { append: true }
14:05:03.890 detox[92706] E artifacts-manager onBeforeCleanup
14:05:03.890 detox[92707] i ipc connection closed primary-92671 /tmp/detox.primary-92671 0 tries remaining of 0
15:05:03.891 detox[92671] i ws-server tester exited session 6f5b82fe-3926-6600-1c3c-01[24](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:25)618dd3ec
14:05:03.891 detox[92707] i ipc secondary-92707 exceeded connection rety amount of  or stopRetrying flag set.
15:05:03.891 detox[9[26](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:27)71] E ws-server@56528 connection :56526<->:56528
14:05:03.891 detox[9[27](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:28)07] E lifecycle tear down environment
14:05:03.891 detox[92707] E lifecycle e2e/tests/healthcheck/healthcheckDefineUser.test.ts
15:05:03.891 detox[92671] i ipc socket disconnected secondary-92707
15:05:03.891 detox[92671] i ws-server tester exited session 1815fec5-21[31](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:32)-976f-ef06-50a590b4[35](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:36)fc
15:05:03.891 detox[92671] E ws-server@56[52](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:53)7 connection :[56](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:57)526<->:5[65](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:66)27
15:05:03.892 detox[92[67](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:68)1] i ipc socket disconnected secondary-92[70](https://github.com/***/***/actions/runs/8281791414/job/22661662589#step:11:71)6

Device logs

Device logs

detox.log

More data, please!

No response

Vadko avatar Mar 14 '24 15:03 Vadko

@Vadko do you run multiple Detox instances on the same machine?

noomorph avatar Mar 17 '24 09:03 noomorph

@noomorph we are running one detox instance with 2 workers per machine

Vadko avatar Mar 18 '24 13:03 Vadko

upd: we've updated to macOS 13.6.5 and xcode 15.2 - still same issue

Vadko avatar Mar 18 '24 21:03 Vadko