-
Notifications
You must be signed in to change notification settings - Fork 73
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
Adding test-retry plugin #456
Changes from 5 commits
0c2877f
8257c86
01572a9
78166db
6921d7a
1eb1781
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ plugins { | |
id 'nebula.ospackage' version "8.3.0" apply false | ||
id "com.diffplug.gradle.spotless" version "3.26.1" | ||
id 'java-library' | ||
id 'org.gradle.test-retry' version '1.3.1' | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
|
@@ -148,8 +149,15 @@ def _numNodes = findProperty('numNodes') as Integer ?: 1 | |
|
||
def opensearch_tmp_dir = rootProject.file('build/private/opensearch_tmp').absoluteFile | ||
opensearch_tmp_dir.mkdirs() | ||
|
||
boolean isCiServer = System.getenv().containsKey("CI") | ||
test { | ||
retry { | ||
if (isCiServer) { | ||
failOnPassedAfterRetry = false | ||
maxRetries = 6 | ||
maxFailures = 10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haven't used test retry, just asking: if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the plugin details, |
||
} | ||
} | ||
include '**/*Tests.class' | ||
systemProperty 'tests.security.manager', 'false' | ||
} | ||
|
@@ -162,6 +170,13 @@ task integTest(type: RestIntegTestTask) { | |
tasks.named("check").configure { dependsOn(integTest) } | ||
|
||
integTest { | ||
retry { | ||
if (isCiServer) { | ||
failOnPassedAfterRetry = false | ||
maxRetries = 6 | ||
maxFailures = 10 | ||
} | ||
} | ||
dependsOn "bundlePlugin" | ||
systemProperty 'tests.security.manager', 'false' | ||
systemProperty 'java.io.tmpdir', opensearch_tmp_dir.absolutePath | ||
|
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.
How did you come up with this value? Will this only work in github CI runners, or will it work in Jenkins hosts too? Ideally it's run in both so that we don't get surprises on test failures during infra builds.
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 value was recommended by https://github.com/gradle/test-retry-gradle-plugin documentation and gradle documentation recommends this line when running something only in CI. I tested it and it works on github actions, I am not sure about jenkins. I saw this also recommended on the opensearch-core PR
if (BuildParams.isCi() == true)
but wasn't used in the end. I was thinking maybe its okay if we don't retry on jenkins as that is run on a larger instance and I didn't AD backend was as flaky there?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.
Fair enough. I think at least adding for github CI is helpful because of how it's usually run on lower-provisioned hosts compared to a local machine or Jenkins like you mentioned. And if it's still flaky, it will be exposed in those places.