-
Notifications
You must be signed in to change notification settings - Fork 729
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
testDependency dir under C:/Users/jenkins/ should not be removed on windows #19791
base: master
Are you sure you want to change the base?
Conversation
@keithc-ca , @pshipton can you please take a look at this PR? |
This change is not only for Windows, the title and description should not suggest otherwise. |
@keithc-ca , This issue is only for windows machines because in the script there is an additional portion for windows systems where they cleanup the /cygdrive/c/Users/jenkins/ directory where the testDependency is usually saved:
Inorder to prevent this we should stop test* directories getting removed only from /cygdrive/c/Users/jenkins/ directory in windows. This step could be a fix instead of the one I have made in this PR:
This way other test* directories will be removed from tmp for other OS and for windows testDependency directory wont be removed in /cygdrive/c/Users/jenkins/ directory. |
Could we not arrange that |
@llxia what are your thoughts on this? |
|
@llxia , Only in windows the cleanup job is clearing directories under /cygdrive/c/Users/jenkins/. Is this step required in windows? |
Ok, |
I will leave @AdamBrousseau to comment on this one.
We have a separate clean-up job to periodically delete the test pipeline pre-staged files. This Cleanup-Nodes.groovy does not need to worry about any pre-staged files from the test pipeline under /cygdrive/c/Users/Jenkins/
I will try to answer this one. The purpose of Cleanup-Nodes.groovy is to remove any leftover files outside the workspace (i.e., from individual users, test jobs, etc). It tries to clean /tmp, /temp, /cores, etc. |
We can turn it off and keep an eye on it. At some point we noticed there was stuff in $HOME on Windows so we added it as a cleanup location. Many tests create artifacts in $TEMP=. The To resolve this PR can we not just change the code to explicitly exclude removing the testDependency dir? |
That was my request. |
6f421cc
to
2d43983
Compare
@keithc-ca , The change has been made. |
There should be nothing created by test in jenkins user's HOME dir. There is plenty created in /tmp as we know but we do not know enough about all the tests to know what test creates what artifact(s). @pshipton @llxia can confirm. |
5c6f427
to
cd1bb28
Compare
@@ -163,6 +163,9 @@ timeout(time: TIMEOUT_TIME.toInteger(), unit: TIMEOUT_UNITS) { | |||
cleanDirsStr += cleanDirs.join(" ${buildWorkspace}/../../") | |||
// shared classes cache | |||
cleanDirsStr += " ${buildWorkspace}/../../javasharedresources /tmp/javasharedresources /temp/javasharedresources" | |||
// to remove {buildWorkspace}/../../test* directories except testDependency | |||
cleanDirsStr = cleanDirsStr.replaceAll("${buildWorkspace}/../../test\\*", "") | |||
sh(script: "ls -d ${buildWorkspace}/../../test* | grep -v 'testDependency' | xargs rm -rf", returnStdout: true).trim() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grep
part of the pipeline should be grep -v '/testDependency$'
.
Signed-off-by: Aswathy S Kumar <[email protected]>
8e0c4a1
to
3414a0f
Compare
@@ -163,6 +163,9 @@ timeout(time: TIMEOUT_TIME.toInteger(), unit: TIMEOUT_UNITS) { | |||
cleanDirsStr += cleanDirs.join(" ${buildWorkspace}/../../") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, or cleanDirs
has to change; as is, this still includes ${buildWorkspace}/../../test*
which will remove the testDependency
directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keithc-ca cleanDirsStr = cleanDirsStr.replaceAll("${buildWorkspace}/../../test\\*", "")
this line would exclude removing test* items from ${buildWorkspace}/../../
directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I missed that line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest a better approach would be to add 'test*'
to cleanDirs
only for non-Windows nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keithc-ca ,
I think even in windows we are required to clean test* dirs in /tmp directory. The only exclusion is for the testDependency dir. Is that not right @llxia @AdamBrousseau?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, are we agreed that we should change those jobs to use a different name than testDependency
, say to external
or support
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@llxia what should be the action taken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smlambert we are going to change testDependency
to externalDependency
at https://github.com/adoptium/aqa-tests/blob/2e34bbfe9931be699284120c04acf9a42680f71e/buildenv/jenkins/JenkinsfileBase#L108-L109. Do you have any objections?
FYI @annaibm @LongyuZhang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @llxia. It will be good to raise an aqa-tests issue for awareness for others that the folder name will be changed to better support automatic cleaning of test material, while maintaining the benefit of preloading test dependencies. Other than communicating the change and checking that any references to that folder are accounted for, I have no objections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adoptium/aqa-tests#5675 is created
3rd party libs under C:/Users/jenkins/testDependency on Windows are pre-staged . However, this testDependency dir gets removed by this cleanup script since it removes patterns starting with test* in C:/Users/jenkins/ directory for windows machines.Due to missing pre-staged jars, the test jobs have to download the 3rd party jar at runtimes. The often cause test jobs failure because of unstable networks.
Helpful links:
https://github.ibm.com/runtimes/infrastructure/issues/9395