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

Latest release of Appium has broken shell commands #153

Open
tking16 opened this issue Feb 9, 2023 · 1 comment
Open

Latest release of Appium has broken shell commands #153

tking16 opened this issue Feb 9, 2023 · 1 comment

Comments

@tking16
Copy link

tking16 commented Feb 9, 2023

I have a Jenkinsfile which runs our Appium Smoke tests, for the past few days the jenkins job has been failing with absolutely no clear explaining, it all runs perfectly fine until it enters the Appium container and tries to run it's first sh command, in which it will hang for about 5 minutes then fail with:

[Pipeline] container
[Pipeline] {
[Pipeline] sh
process apparently never started in /home/jenkins/agent/workspace/android-at-tests@tmp/durable-0f6a0121
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)

So I've now just changed the image from image: "appium/appium" to image: "appium/appium:v1.22.0-p0" and it's working, which leads me to believe a recent update is causing the hang to occur. Maybe since a big refactor?

Jenkinsfile code to reproduce issue:

pipeline {
    agent {
        kubernetes {
            label 'android-at'
            defaultContainer 'jnlp'
            yaml '''
              apiVersion: v1
              kind: Pod
              metadata:
                labels:
                  deploy: android-at
              spec:
                containers:
                  - name: jnlp
                    image: jenkins/jnlp-slave
                  - name: appium
                    image: appium/appium
                    volumeMounts:
                      - mountPath: /root/.android/
                        name: adb
                        readOnly: true
                  - name: at-app
                    image: xxxxxx
                    command:
                      - cat
                    tty: true
                volumes:
                  - name: adb
                    secret:
                      defaultMode: 420
                      optional: false
                      secretName: adb
            '''
        }
    }

    stages {
        stage('Fetch apk') {
            steps {
                container('at-app') {
                    sh "curl ${APK_BUILD_OUTPUT_PATH} > app-global-debug.apk" // This all works okay
                }
            }
        }
stage('Run tests') {
            environment {
            // settings env vars
            }
            steps {
                container('appium') {
                    // Everything hangs and fails from here
                    sh "echo 'connecting to $params.DEVICE device...'"
                    sh "adb connect ${GALAXY_TAB_S8_IP}:5555"

                    
                }
}
@budtmo
Copy link
Member

budtmo commented Feb 10, 2023

Hi @tking16 ,

pass all needed parameters that the container need and just run this last command inside sh command, it should fix the issue. let me know if you still have the issue.
If everything work fine, could you please close this issue.

it is interesting that you deploy container every time there is a test instead of having device farm before. could you also write documentation about that @tking16 ? you can commit the documentation under examples/jenkins if you like, so it will benefit the other users that there are ways to use this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants