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

bug: cannot connect to iOS simulator in GitHub action context, simulator not reachable #17743

Closed
1 task done
kopax-polyconseil opened this issue Nov 8, 2022 · 3 comments
Closed
1 task done
Labels
Cannot Reproduce invalid bug Needs Info typically non-actionable; needs author to respond

Comments

@kopax-polyconseil
Copy link

kopax-polyconseil commented Nov 8, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I am not able to run test on iOS Simulator in the context of GitHub action

Expected Behavior

I am able to run test on iOS Simulator in the context of GitHub action

Minimal Reproducible Example

e2e-ios-app.yml
  name: Tests e2e iOS Native

on:
  workflow_dispatch:
    inputs:
      tbd:
        description: "tbd"
        required: false
        type: string

jobs:
  e2e-ios-native:
    strategy:
      matrix:
        include:
          - osVersion: '15.2'
            os: 'iOS'
            model: 'iPhone 8'
    env:
      CI: true
      APPIUM_TEST_SERVER_PORT: 4723
      APPIUM_TEST_SERVER_HOST: 0.0.0.0
      APPIUM_STARTUP_TIMEOUT_SEC: 30
      _FORCE_LOGS: 1
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v3
      - uses: futureware-tech/simulator-action@v2
        with:
          model: ${{ matrix.model }}
          os: ${{ matrix.os }}
          os_version: ${{ matrix.os_version }}
      - uses: actions/setup-node@v3
        with:
          node-version-file: '.nvmrc'
      - run: yarn install
      - run: |
          mkdir apps
          wget https://github.com/webdriverio/native-demo-app/releases/download/v0.4.0/iOS-Simulator-NativeDemoApp-0.4.0.app.zip -P apps
      - run: |
          npm config set legacy-peer-deps true
          npm install -g appium@next
          npm install -g appium-doctor
        name: Install dev dependencies
      - run: |
          cwd=$(pwd)
          pushd "$cwd"
          cd ~
          appium driver install xcuitest
          appium driver install safari
          appium-doctor
          nohup appium server \
            --port=$APPIUM_TEST_SERVER_PORT \
            --address=$APPIUM_TEST_SERVER_HOST \
            --relaxed-security \
            2>&1 > "$cwd/appium.log" &
          popd
        name: Start Appium server
      - run: |
          seconds_started=$(date +%s)
          while ! nc -z $APPIUM_TEST_SERVER_HOST $APPIUM_TEST_SERVER_PORT; do
            sleep 0.1
            seconds_elapsed=$(( $(date +%s) - seconds_started ))
            if [[ $seconds_elapsed -gt $APPIUM_STARTUP_TIMEOUT_SEC ]]; then
              echo "Appium server was unable to start within $APPIUM_STARTUP_TIMEOUT_SEC seconds timeout"
              exit 1
            fi
          done
        name: Wait for Appium server startup
      - run:  IOS_DEVICE_NAME="iPhone 13" IOS_PLATFORM_VERSION=15.2 yarn ios.app
        name: Run functional tests
      - name: Save server output
        if: ${{ always() }}
        uses: actions/upload-artifact@master
        with:
          name: appium.log
          path: appium.log
      - name: Show appium server output
        if: ${{ always() }}
        run: cat appium.log
appium.log
  • is booted while its UI is not visible. Trying to restart it with the Simulator window visible
  • Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
  • connect ECONNREFUSED 127.0.0.1:8100
  2022-11-07 21:49:53:321 [Appium] Welcome to Appium v2.0.0-beta.46
2022-[11](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:12)-07 21:49:53:328 [Appium] Non-default server args:
2022-11-07 21:49:53:330 [Appium] { address: 'localhost', basePath: '/', relaxedSecurityEnabled: true }
2022-11-07 21:49:53:331 [Appium] Attempting to load driver xcuitest...
2022-11-07 21:49:53:333 [Appium] Requiring driver at /Users/runner/.appium/node_modules/appium-xcuitest-driver
2022-11-07 21:49:55:724 [Appium] Attempting to load driver safari...
2022-11-07 21:49:55:725 [Appium] Requiring driver at /Users/runner/.appium/node_modules/appium-safari-driver
2022-11-07 21:49:56:044 [Appium] Appium REST http interface listener started on localhost:4723
2022-11-07 21:49:56:045 [Appium] Available drivers:
2022-11-07 21:49:56:045 [Appium]   - xcuitest@4.[12](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:13).2 (automationName 'XCUITest')
2022-11-07 21:49:56:046 [Appium]   - safari@3.2.4 (automationName 'Safari')
2022-11-07 21:49:56:046 [Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
2022-11-07 21:49:58:807 [HTTP] --> POST /session
2022-11-07 21:49:58:808 [HTTP] {"capabilities":{"alwaysMatch":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240}}
2022-11-07 21:49:58:810 [AppiumDriver@b522] Calling AppiumDriver.createSession() with args: [{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},null,{"alwaysMatch":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},"firstMatch":[{}]}]
2022-11-07 21:49:58:812 [AppiumDriver@b522] Event 'newSessionRequested' logged at 1667857798811 (21:49:58 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:49:58:819 [Appium] Attempting to find matching driver for automationName 'XCUITest' and platformName 'iOS'
2022-11-07 21:49:58:820 [Appium] The 'xcuitest' driver was installed and matched caps.
2022-11-07 21:49:58:820 [Appium] Will require it at /Users/runner/.appium/node_modules/appium-xcuitest-driver
2022-11-07 21:49:58:820 [Appium] Requiring driver at /Users/runner/.appium/node_modules/appium-xcuitest-driver
2022-11-07 21:49:58:821 [AppiumDriver@b522] Appium v2.0.0-beta.46 creating new XCUITestDriver (v4.12.2) session
2022-11-07 21:49:58:821 [AppiumDriver@b522] Checking BaseDriver versions for Appium and XCUITestDriver
2022-11-07 21:49:58:821 [AppiumDriver@b522] Appium's BaseDriver version is 8.7.3
2022-11-07 21:49:58:821 [AppiumDriver@b522] XCUITestDriver's BaseDriver version is 8.7.3
2022-11-07 21:49:58:823 [AppiumDriver@b522] Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
2022-11-07 21:49:58:825 [XCUITestDriver@2f81] Creating session with W3C capabilities: {
2022-11-07 21:49:58:825 [XCUITestDriver@2f81]   "alwaysMatch": {
2022-11-07 21:49:58:826 [XCUITestDriver@2f81]     "browserName": "safari",
2022-11-07 21:49:58:826 [XCUITestDriver@2f81]     "platformName": "iOS",
2022-11-07 21:49:58:826 [XCUITestDriver@2f81]     "appium:deviceName": "iPhone 12",
2022-11-07 21:49:58:826 [XCUITestDriver@2f81]     "appium:platformVersion": "15.2",
2022-11-07 21:49:58:826 [XCUITestDriver@2f81]     "appium:orientation": "PORTRAIT",
2022-11-07 21:49:58:826 [XCUITestDriver@2f81]     "appium:automationName": "XCUITest",
2022-11-07 21:49:58:827 [XCUITestDriver@2f81]     "appium:newCommandTimeout": 240
2022-11-07 21:49:58:827 [XCUITestDriver@2f81]   },
2022-11-07 21:49:58:827 [XCUITestDriver@2f81]   "firstMatch": [
2022-11-07 21:49:58:827 [XCUITestDriver@2f81]     {}
2022-11-07 21:49:58:827 [XCUITestDriver@2f81]   ]
2022-11-07 21:49:58:828 [XCUITestDriver@2f81] }
2022-11-07 21:49:58:842 [XCUITestDriver@2f81 (b11bbfed)] Session created with session id: b11bbfed-1120-4f87-94bb-e9454c3bfaa6
2022-11-07 21:49:58:917 [XCUITest] Current user: 'runner'
2022-11-07 21:50:05:377 [XCUITestDriver@2f81 (b11bbfed)] iOS SDK Version set to '15.2'
2022-11-07 21:50:05:861 [iOSSim] Constructing iOS simulator for Xcode version [13](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:14).2.1 with udid '5EE6DC02-C3B7-4087-8139-1B7995320379'
2022-11-07 21:50:05:863 [XCUITestDriver@2f81 (b11bbfed)] Determining device to run tests on: udid: '5EE6DC02-C3B7-4087-8139-1B7995320379', real device: false
2022-11-07 21:50:05:865 [XCUITestDriver@2f81 (b11bbfed)] Event 'xcodeDetailsRetrieved' logged at 1667857805865 (21:50:05 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:50:05:865 [XCUITestDriver@2f81 (b11bbfed)] Safari test requested
2022-11-07 21:50:05:866 [XCUITestDriver@2f81 (b11bbfed)] Event 'appConfigured' logged at 1667857805866 (21:50:05 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:50:05:866 [XCUITestDriver@2f81 (b11bbfed)] Event 'resetStarted' logged at 1667857805866 (21:50:05 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:50:07:013 [iOSSim] Cleaning mobile safari data files
2022-11-07 21:50:07:299 [iOSSim] Checking whether simulator has been run before: yes
2022-11-07 21:50:07:300 [iOSSim] Checking whether simulator has been run before: yes
2022-11-07 21:50:07:301 [iOSSim] Building bundle path map
2022-11-07 21:50:07:502 [XCUITestDriver@2f81 (b11bbfed)] Event 'resetComplete' logged at 1667857807502 (21:50:07 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:50:07:503 [XCUITestDriver@2f81 (b11bbfed)] Using WDA path: '/Users/runner/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent'
2022-11-07 21:50:07:504 [XCUITestDriver@2f81 (b11bbfed)] Using WDA agent: '/Users/runner/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
2022-11-07 21:50:07:898 [IOSSimulatorLog] Starting log capture for iOS Simulator with udid '5EE6DC02-C3B7-4087-8139-1B7995320379' using simctl
2022-11-07 21:50:08:540 [XCUITestDriver@2f81 (b11bbfed)] Event 'logCaptureStarted' logged at 1667857808539 (21:50:08 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:50:08:541 [XCUITestDriver@2f81 (b11bbfed)] Setting up simulator
2022-11-07 21:50:08:541 [XCUITest] No reason to set locale
2022-11-07 21:50:08:542 [XCUITest] No iOS / app preferences to set
2022-11-07 21:50:08:542 [XCUITest] Setting did not need to be updated
2022-11-07 21:50:08:545 [iOSSim] Setting preferences of 5EE6DC02-C3B7-4087-8139-1B7995320379 Simulator to {"SimulatorWindowOrientation":"Portrait","SimulatorWindowRotationAngle":0,"ConnectHardwareKeyboard":false}
2022-11-07 21:50:08:545 [iOSSim] Setting common Simulator preferences to {"RotateWindowWhenSignaledByGuest":true,"StartLastDeviceOnLaunch":false,"DetachOnWindowClose":false,"AttachBootedOnStart":true,"ConnectHardwareKeyboard":false,"PasteboardAutomaticSync":false}
2022-11-07 21:50:10:543 [iOSSim] Updated 5EE6DC02-C3B7-4087-8139-1B7995320379 Simulator preferences at '/Users/runner/Library/Preferences/com.apple.iphonesimulator.plist' with {"RotateWindowWhenSignaledByGuest":true,"StartLastDeviceOnLaunch":false,"DetachOnWindowClose":false,"AttachBootedOnStart":true,"ConnectHardwareKeyboard":false,"PasteboardAutomaticSync":false,"DevicePreferences":{"5EE6DC02-C3B7-4087-8139-1B7995320379":{"SimulatorWindowOrientation":"Portrait","SimulatorWindowRotationAngle":0,"ConnectHardwareKeyboard":false}}}
2022-11-07 21:50:10:997 [iOSSim] Simulator '5EE6DC02-C3B7-4087-8139-1B7995320379' is booted while its UI is not visible. Trying to restart it with the Simulator window visible
2022-11-07 21:50:[14](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:15):961 [iOSSim] Starting Simulator UI: open -Fn /Applications/Xcode_13.2.1.app/Contents/Developer/Applications/Simulator.app
2022-11-07 21:50:19:344 [XCUITestDriver@2f81 (b11bbfed)] Parsed BUILD_DIR configuration value: '/Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent-dtmoeonrefnxsncuficthanbldlc/Build/Products'
2022-11-07 21:50:19:347 [XCUITestDriver@2f81 (b11bbfed)] Got derived data root: '/Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent-dtmoeonrefnxsncuficthanbldlc'
2022-11-07 21:50:55:262 [iOSSim] Simulator with UDID 5EE6DC02-C3B7-4087-8139-1B7995320379 booted in 44.713s
2022-11-07 21:50:56:147 [XCUITestDriver@2f81 (b11bbfed)] Event 'simStarted' logged at 1667857856145 (21:50:56 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:51:03:192 [XCUITestDriver@2f81 (b11bbfed)] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
2022-11-07 21:51:03:193 [DevCon Factory] Requesting connection for device 5EE6DC02-C3B7-4087-8139-1B7995320379 on local port 8100
2022-11-07 21:51:03:194 [DevCon Factory] Cached connections count: 0
2022-11-07 21:51:03:194 [DevCon Factory] Successfully requested the connection for 5EE6DC02-C3B7-4087-8139-1B7995320379:8100
2022-11-07 21:51:03:195 [XCUITestDriver@2f81 (b11bbfed)] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
2022-11-07 21:51:03:199 [WD Proxy] Matched '/status' to command name 'getStatus'
2022-11-07 21:51:03:200 [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
2022-11-07 21:51:03:221 [WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
2022-11-07 21:51:03:222 [XCUITestDriver@2f81 (b11bbfed)] WDA is not listening at 'http://127.0.0.1:8100/'
2022-11-07 21:51:03:222 [XCUITestDriver@2f81 (b11bbfed)] WDA is currently not running. There is nothing to cache
2022-11-07 21:51:03:222 [XCUITestDriver@2f81 (b11bbfed)] Trying to start WebDriverAgent 2 times with 10000ms interval
2022-11-07 21:51:03:223 [XCUITestDriver@2f81 (b11bbfed)] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
2022-11-07 21:51:03:223 [XCUITestDriver@2f81 (b11bbfed)] Event 'wdaStartAttempted' logged at 1667857863223 (21:51:03 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:51:03:223 [XCUITestDriver@2f81 (b11bbfed)] Launching WebDriverAgent on the device
2022-11-07 21:51:03:721 [XCUITestDriver@2f81 (b11bbfed)] Stored the recent WebDriverAgent upgrade timestamp 1667857732405 at '/Users/runner/.appium/webdriveragent/upgrade.time'
2022-11-07 21:51:03:721 [XCUITestDriver@2f81 (b11bbfed)] There is no need to perform the project cleanup. A fresh install has been detected
2022-11-07 21:51:03:722 [WebDriverAgent] Killing running processes 'xcodebuild.*5EE6DC02-C3B7-4087-8139-1B7995320379, 5EE6DC02-C3B7-4087-8139-1B7995320379.*XCTRunner, xctest.*5EE6DC02-C3B7-4087-8139-1B7995320379' for the device 5EE6DC02-C3B7-4087-8139-1B7995320379...
2022-11-07 21:51:04:791 [WebDriverAgent] 'pgrep -if 5EE6DC02-C3B7-4087-8139-1B7995320379.*XCTRunner' didn't detect any matching processes. Return code: 1
2022-11-07 21:51:05:366 [WebDriverAgent] 'pgrep -if xcodebuild.*5EE6DC02-C3B7-4087-8139-1B7995320379' didn't detect any matching processes. Return code: 1
2022-11-07 21:51:06:137 [WebDriverAgent] 'pgrep -if xctest.*5EE6DC02-C3B7-4087-8139-1B7995320379' didn't detect any matching processes. Return code: 1
2022-11-07 21:51:06:140 [XCUITestDriver@2f81 (b11bbfed)] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Users/runner/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent-dtmoeonrefnxsncuficthanbldlc -destination id=5EE6DC02-C3B7-4087-8139-1B7995320379 IPHONEOS_DEPLOYMENT_TARGET=[15](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:16).2 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Users/runner/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent'
2022-11-07 21:51:06:235 [XCUITestDriver@2f81 (b11bbfed)] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability
2022-11-07 21:51:59:485 [HTTP] <-- POST /session - - ms - -
2022-11-07 21:51:59:488 [HTTP] 
2022-11-07 21:52:00:084 [HTTP] --> POST /session
2022-11-07 21:52:00:085 [HTTP] {"capabilities":{"alwaysMatch":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240}}
2022-11-07 21:52:00:275 [AppiumDriver@b522] Calling AppiumDriver.createSession() with args: [{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},null,{"alwaysMatch":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},"firstMatch":[{}]}]
2022-11-07 21:52:00:276 [AppiumDriver@b522] Event 'newSessionRequested' logged at [16](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:17)67857920275 (21:52:00 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:52:00:281 [Appium] Attempting to find matching driver for automationName 'XCUITest' and platformName 'iOS'
2022-11-07 21:52:00:281 [Appium] The 'xcuitest' driver was installed and matched caps.
2022-11-07 21:52:00:281 [Appium] Will require it at /Users/runner/.appium/node_modules/appium-xcuitest-driver
2022-11-07 21:52:00:5[17](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:18) [Appium] Requiring driver at /Users/runner/.appium/node_modules/appium-xcuitest-driver
2022-11-07 21:52:00:5[18](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:19) [AppiumDriver@b522] Appium v2.0.0-beta.46 creating new XCUITestDriver (v4.12.2) session
2022-11-07 21:52:00:518 [AppiumDriver@b522] Checking BaseDriver versions for Appium and XCUITestDriver
2022-11-07 21:52:00:5[19](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:20) [AppiumDriver@b522] Appium's BaseDriver version is 8.7.3
[20](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:21)22-11-07 [21](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:22):52:00:519 [AppiumDriver@b5[22](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:23)] XCUITestDriver's BaseDriver version is 8.7.3
2022-11-07 21:52:00:5[24](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:25) [AppiumDriver@b522] Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
2022-11-07 21:52:00:526 [XCUITestDriver@f75f] Creating session with W3C capabilities: {
2022-11-07 21:52:00:526 [XCUITestDriver@f75f]   "alwaysMatch": {
2022-11-07 21:52:00:527 [XCUITestDriver@f75f]     "browserName": "safari",
2022-11-07 21:52:00:527 [XCUITestDriver@f75f]     "platformName": "iOS",
2022-11-07 21:52:01:009 [XCUITestDriver@f75f]     "appium:deviceName": "iPhone 12",
2022-11-07 21:52:01:009 [XCUITestDriver@f75f]     "appium:platformVersion": "15.2",
2022-11-07 21:52:01:010 [XCUITestDriver@f75f]     "appium:orientation": "PORTRAIT",
2022-11-07 21:52:01:010 [XCUITestDriver@f75f]     "appium:automationName": "XCUITest",
2022-11-07 21:52:01:010 [XCUITestDriver@f75f]     "appium:newCommandTimeout": 240
2022-11-07 21:52:01:011 [XCUITestDriver@f75f]   },
2022-11-07 21:52:01:011 [XCUITestDriver@f75f]   "firstMatch": [
2022-11-07 21:52:01:011 [XCUITestDriver@f75f]     {}
2022-11-07 21:52:01:012 [XCUITestDriver@f75f]   ]
2022-11-07 21:52:01:012 [XCUITestDriver@f75f] }
2022-11-07 21:52:01:134 [XCUITestDriver@f75f (81488018)] Session created with session id: 81488018-31a8-438f-889b-d58271188ae3
2022-11-07 21:52:02:282 [XCUITest] Current user: 'runner'
2022-11-07 21:52:02:284 [XCUITestDriver@f75f (81488018)] iOS SDK Version set to '15.2'
2022-11-07 21:52:10:120 [iOSSim] Constructing iOS simulator for Xcode version 13.2.1 with udid '5EE6DC02-C3B7-4087-8139-1B7995320379'
2022-11-07 21:52:10:122 [XCUITestDriver@f75f (81488018)] Determining device to run tests on: udid: '5EE6DC02-C3B7-4087-8139-1B7995320379', real device: false
2022-11-07 21:52:10:124 [XCUITestDriver@f75f (81488018)] Event 'xcodeDetailsRetrieved' logged at 1667857930124 (21:52:10 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:52:10:124 [XCUITestDriver@f75f (81488018)] Safari test requested
2022-11-07 21:52:10:1[25](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:26) [XCUITestDriver@f75f (81488018)] Event 'appConfigured' logged at 1667857930125 (21:52:10 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:52:10:125 [XCUITestDriver@f75f (81488018)] Event 'resetStarted' logged at 1667857930125 (21:52:10 GMT+0000 (Coordinated Universal Time))
2022-11-07 21:52:14:374 [XCUITestDriver@2f81 (b11bbfed)] Waiting up to 60000ms for WebDriverAgent to start
2022-11-07 21:52:14:376 [XCUITestDriver@2f81 (b11bbfed)] Matched '/status' to command name 'getStatus'
2022-11-07 21:52:14:565 [XCUITestDriver@2f81 (b11bbfed)] Proxying [GET /status] to [GET http://1[27](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:28).0.0.1:8100/status] with no body
2022-11-07 21:52:14:7[34](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:35) [XCUITestDriver@2f[81](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:82) (b11bbfed)] connect ECONNREFUSED 127.0.0.1:8[100](https://github.com/pass-culture/pass-culture-app-native/actions/runs/3414195480/jobs/5681828032#step:11:101)
mocha.log
  [0-0] 2022-11-07T21:58:00.273Z ERROR webdriver: Request failed with status undefined due to TimeoutError: Timeout awaiting 'request' for 120000ms when running "http://localhost:4723/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240}}"
[0-0] 2022-11-07T21:58:00.274Z ERROR webdriver: TimeoutError: Timeout awaiting 'request' for 120000ms when running "http://localhost:4723/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240}}"
[0-0]     at getTimeoutError (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/webdriver/build/utils.js:329:24)
[0-0]     at NodeJSRequest._request (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/webdriver/build/request/index.js:154:59)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0]     at async startWebDriverSession (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/webdriver/build/utils.js:68:20)
[0-0]     at async Function.newSession (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/webdriver/build/index.js:46:45)
[0-0]     at async remote (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/webdriverio/build/index.js:77:22)
[0-0]     at async Runner._startSession (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/@wdio/runner/build/index.js:223:56)
[0-0]     at async Runner._initSession (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/@wdio/runner/build/index.js:176:25)
[0-0]     at async Runner.run (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/@wdio/runner/build/index.js:88:19)
[0-0] 2022-11-07T21:58:00.292Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] Timeout awaiting 'request' for 120000ms when running "http://localhost:4723/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"safari","platformName":"iOS","appium:deviceName":"iPhone 12","appium:platformVersion":"15.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:newCommandTimeout":240}}"
[0-0]     at startWebDriverSession (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/webdriver/build/utils.js:73:15)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0]     at async Function.newSession (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/webdriver/build/index.js:46:45)
[0-0]     at async remote (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/webdriverio/build/index.js:77:22)
[0-0]     at async Runner._startSession (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/@wdio/runner/build/index.js:223:56)
2022-11-07T21:58:00.472Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0]     at async Runner._initSession (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/@wdio/runner/build/index.js:176:25)
[0-0] FAILED in safari - /e2e/tests/specs/browser.checkbox.spec.ts
[0-0]     at async Runner.run (/Users/runner/work/pass-culture-app-native/pass-culture-app-native/node_modules/@wdio/runner/build/index.js:88:19)

Environment

  • Operating system: macos-latest
  • If running via appium CLI...
    • Appium CLI version (output of appium --version): 2.0.0-beta.46
    • Node.js version (output of node --version): v18.7.0
    • npm version (output of npm --version): yarn 1.22.15
    • Last appium version which did not exhibit the problem: NA
  • If running Appium Desktop, its version: NA
  • Appium driver(s) and their version(s): xcuitest + safari
  • Appium plugin(s) and their version(s): NA
  • Platform and version under test: macos app + browser
  • Real device or emulator/simulator: simulator

Link to Appium Logs

No response

Futher Information

I am not sure if this is the right place to ask. I will in any case, share a working workflow for the whole community, so thanks for participating.

@kopax-polyconseil kopax-polyconseil added Bug a problem that needs fixing Needs Triage bugs which are not yet confirmed labels Nov 8, 2022
@mykola-mokhnach
Copy link
Collaborator

I'm not quite sure if the issue has anything to do with Appium itself. Perhaps, this is more about setting proper timeouts on the client side, because CI env is usually times slower in comparison to the local one.

2022-11-07 21:51:59:485 [HTTP] <-- POST /session - - ms - -

means the connection from client side has been terminated unexpectedly.

You could also enable xcodebuild logging to see more details on what is happening and/or check existing xcuitest e2e test properties (these tests run on Azure though): https://github.com/appium/appium-xcuitest-driver/tree/master/ci-jobs

@mykola-mokhnach mykola-mokhnach added Cannot Reproduce invalid bug Needs Info typically non-actionable; needs author to respond and removed Bug a problem that needs fixing Needs Triage bugs which are not yet confirmed labels Nov 8, 2022
@kopax-polyconseil
Copy link
Author

kopax-polyconseil commented Nov 8, 2022

Thanks for your quick reply.

You could also enable xcodebuild logging

We are not building an application, instead we use iOS-Simulator-NativeDemoApp-0.4.0.app.zip available here : https://github.com/webdriverio/native-demo-app/releases

So I am not sure how we can do that.

means the connection from client side has been terminated unexpectedly.

I will try to increase to :

{
    "waitforTimeout": 90000,
    "connectionRetryTimeout": 240000,
    "connectionRetryCount": 3
}

And let you know if it help.

I also checked https://github.com/appium/appium-xcuitest-driver/tree/master/ci-jobs, and I am not sure what to look at, could you please share a bit more info ? Thanks!

@mykola-mokhnach
Copy link
Collaborator

Closed as third party issue.

It is expected that CI env is usually much slower than a local one. Consider increasing timeouts everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cannot Reproduce invalid bug Needs Info typically non-actionable; needs author to respond
Projects
None yet
Development

No branches or pull requests

2 participants