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

Some test result files are missing when test script in dockerExecute failed due to timeout #4987

Open
xidian237 opened this issue Jul 15, 2024 · 1 comment
Labels
stale marks stale issues and pull requests

Comments

@xidian237
Copy link

xidian237 commented Jul 15, 2024

Hi experts,

Our team is using the dockerExecute to start the test script:
dockerExecute(script: this, dockerImage: landscapeDockerImage()) { sh """ ... bash <testFileName>.sh ... """ }
I have one question here, I noticed that when we use dockerExecute to start the test, the test is actually running in a pod created by the dockerExecute function, and the files under the directory /jenkinsdata/create_Landscape_for_Tests_lin/workspace(I guess this path is the workspace of the Jenkins work node) and /home/jenkins/agent/workspace/create_Landscape_for_Tests_lin (the work dir of the pod)
are all the same, how could it be implemented? Does the dockerExecute mount this two directories?

---------------------------------------------------------------------------------------------------
During the test process, the test script generates some test result files such as XXX.txt and XXX.xml under the path
/home/jenkins/agent/workspace/create_Landscape_for_Tests_lin
image
image

but now our test script failed due to the timeout,

[2024-07-10T15:52:55.801Z] Cancelling nested steps due to timeout
[2024-07-10T15:52:55.804Z] Sending interrupt signal to process
[2024-07-10T15:52:55.805Z] Killing processes
[2024-07-10T15:52:56.102Z] kill finished with exit code 0

and there is 'unstash failed' error,

script returned exit code 143
[2024-07-10T15:52:56.315Z] [Pipeline] sh
[2024-07-10T15:52:56.889Z] [Pipeline] echo
[2024-07-10T15:52:56.896Z] Stash content: container-6a35cb5b-030a-4eff-b1c3-7fb4f4987643 (includes: /*, excludes: /node_modules/,nohup.out,.git/, useDefaultExcludes: true, allowEmpty: true)
[2024-07-10T15:52:56.906Z] [Pipeline] stash
[2024-07-10T15:53:49.529Z] Stashed 23487 file(s)
[2024-07-10T15:53:49.534Z] [Pipeline] }
[2024-07-10T15:53:49.610Z] [Pipeline] // container
[2024-07-10T15:53:49.633Z] [Pipeline] }
[2024-07-10T15:53:49.725Z] [Pipeline] // node
[2024-07-10T15:53:49.747Z] [Pipeline] }
[2024-07-10T15:53:49.811Z] [Pipeline] // podTemplate
[2024-07-10T15:53:49.840Z] [Pipeline] echo
[2024-07-10T15:53:49.844Z] Unstash content: container-6a35cb5b-030a-4eff-b1c3-7fb4f4987643
[2024-07-10T15:53:49.852Z] [Pipeline] unstash
[2024-07-10T15:53:55.802Z] Body did not finish within grace period; terminating with extreme prejudice
[2024-07-10T15:53:55.818Z] [Pipeline] echo
[2024-07-10T15:53:55.823Z] Unstash failed: container-6a35cb5b-030a-4eff-b1c3-7fb4f4987643 (null)
[2024-07-10T15:53:55.847Z] [Pipeline] echo
[2024-07-10T15:53:55.853Z] invalidate stash container-6a35cb5b-030a-4eff-b1c3-7fb4f4987643
[2024-07-10T15:53:55.879Z] [Pipeline] echo
[2024-07-10T15:53:55.884Z] Stash content: container-6a35cb5b-030a-4eff-b1c3-7fb4f4987643 (includes: **/., excludes: **/*, useDefaultExcludes: true, allowEmpty: true)
[2024-07-10T15:53:55.894Z] [Pipeline] stash
[2024-07-10T15:53:55.900Z] Warning: overwriting stash ‘container-6a35cb5b-030a-4eff-b1c3-7fb4f4987643’
[2024-07-10T15:53:56.466Z] Stashed 0 file(s)
[2024-07-10T15:53:56.478Z] [Pipeline] libraryResource
[2024-07-10T15:53:56.545Z] [Pipeline] echo
[2024-07-10T15:53:56.550Z] ----------------------------------------------------------
[2024-07-10T15:53:56.550Z] --- An error occurred in the library step: dockerExecuteOnKubernetes
[2024-07-10T15:53:56.550Z] ----------------------------------------------------------
[2024-07-10T15:53:56.550Z]
[2024-07-10T15:53:56.550Z] The following parameters were available to the step:
[2024-07-10T15:53:56.550Z] ***
[2024-07-10T15:53:56.550Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2024-07-10T15:53:56.550Z] *** WARNING: this may reveal sensitive information. ***
[2024-07-10T15:53:56.550Z] ***
[2024-07-10T15:53:56.550Z]
[2024-07-10T15:53:56.550Z] The error was:
[2024-07-10T15:53:56.550Z] ***
[2024-07-10T15:53:56.550Z] org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
[2024-07-10T15:53:56.550Z] ***
[2024-07-10T15:53:56.550Z]
[2024-07-10T15:53:56.550Z] Further information:
[2024-07-10T15:53:56.550Z] * Documentation of library step dockerExecuteOnKubernetes: https://sap.github.io/jenkins-library/steps/dockerExecuteOnKubernetes/
[2024-07-10T15:53:56.551Z] * Source code of library step dockerExecuteOnKubernetes: https://github.com/SAP/jenkins-library/blob/master/vars/dockerExecuteOnKubernetes.groovy
[2024-07-10T15:53:56.551Z] * Library documentation: https://sap.github.io/jenkins-library/
[2024-07-10T15:53:56.551Z] * Library repository: https://github.com/SAP/jenkins-library/
[2024-07-10T15:53:56.551Z]
[2024-07-10T15:53:56.551Z] ----------------------------------------------------------
[2024-07-10T15:53:56.551Z] --- End library step of: dockerExecuteOnKubernetes ---
[2024-07-10T15:53:56.561Z] [Pipeline] libraryResource
[2024-07-10T15:53:56.627Z] [Pipeline] echo
[2024-07-10T15:53:56.631Z] ----------------------------------------------------------
[2024-07-10T15:53:56.632Z] --- An error occurred in the library step: dockerExecute
[2024-07-10T15:53:56.632Z] ----------------------------------------------------------
[2024-07-10T15:53:56.632Z]
[2024-07-10T15:53:56.632Z] The following parameters were available to the step:
[2024-07-10T15:53:56.632Z] ***
[2024-07-10T15:53:56.632Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2024-07-10T15:53:56.632Z] *** WARNING: this may reveal sensitive information. ***
[2024-07-10T15:53:56.632Z] ***
[2024-07-10T15:53:56.632Z]
[2024-07-10T15:53:56.632Z] The error was:
[2024-07-10T15:53:56.632Z] ***
[2024-07-10T15:53:56.632Z] org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
[2024-07-10T15:53:56.632Z] ***
[2024-07-10T15:53:56.632Z]
[2024-07-10T15:53:56.632Z] Further information:
[2024-07-10T15:53:56.632Z] * Documentation of library step dockerExecute: https://sap.github.io/jenkins-library/steps/dockerExecute/
[2024-07-10T15:53:56.632Z] * Source code of library step dockerExecute: https://github.com/SAP/jenkins-library/blob/master/vars/dockerExecute.groovy
[2024-07-10T15:53:56.632Z] * Library documentation: https://sap.github.io/jenkins-library/
[2024-07-10T15:53:56.632Z] * Library repository: https://github.com/SAP/jenkins-library/
[2024-07-10T15:53:56.632Z]
[2024-07-10T15:53:56.632Z] ----------------------------------------------------------
[2024-07-10T15:53:56.632Z] --- End library step of: dockerExecute ---

And during the archive process, we found under the path

/jenkinsdata/create_Landscape_for_Tests_lin/workspace

there are XXX.xml files but no XXX.txt files(Both of the files are generated during the test process)
Could you help to find out the root cause why the XXX.txt files are missing, is it relevant to the unstash failed error?
Thanks.

Copy link
Contributor

Thank you for your contribution! This issue is stale because it has been open 60 days with no activity. In order to keep it open, please remove stale label or add a comment within the next 10 days. If you need a Piper team member to remove the stale label make sure to add @SAP/jenkins-library-team to your comment.

@github-actions github-actions bot added the stale marks stale issues and pull requests label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale marks stale issues and pull requests
Projects
None yet
Development

No branches or pull requests

1 participant