-
Notifications
You must be signed in to change notification settings - Fork 14k
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
KAFKA-17672 Run quarantined tests separately #17329
Conversation
In the build, we can see the main tests and the quarantined tests being run https://github.com/apache/kafka/actions/runs/11130826247/job/30931421135?pr=17329#step:7:21
So the test collection and JUnit reporting are working. |
@chia7712 can you take a look? |
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.
@mumrah thanks for this patch. that is cooooooooooooooool!
if (ext.isGithubActions) { | ||
def dest = rootProject.layout.buildDirectory.dir("junit-xml/${project.name}").get().asFile | ||
println "Copy JUnit XML for ${project.name} to $dest" | ||
ant.copy(todir: "$dest/quarantinedTest", failonerror: "false") { |
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.
Has it been included in the artifact? The artifact link (https://github.com/apache/kafka/actions/runs/11130826247/artifacts/2002753330) doesn't seem to include it.
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.
Fixed
I realized we should not have
This means we can also stop forcing ignoreFailures to true in the CI build. If we have more than 20 flaky failures in the |
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.
If we have more than 20 flaky failures in the quarantinedTest task, it will fail the overall Gradle run.
pardon me, I assumed the quarantined tests should NOT impact the CI flow for PR
build.gradle
Outdated
@@ -501,6 +504,7 @@ subprojects { | |||
|
|||
useJUnitPlatform { | |||
includeEngines 'junit-jupiter' | |||
excludeTags 'quarantined' |
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 can we use deflake.yml
to run flaky tests if they are excluded by the test task? Maybe we should enable deflake.yml
to also run quarantinedTest
?
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.
Good point, I will update that job.
@Target({ElementType.TYPE, ElementType.METHOD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Tag("quarantined") | ||
public @interface Quarantined { |
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.
Could you please update KIP based on this new tag? the tag name in KIP is Flaky
rather than Quarantined
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.
Actually, I wonder if @Flaky
is better for the annotation.
The "quarantine" as a concept includes flaky tests as well as new integration tests, so it might make sense to keep the flaky annotation.
@Tag("quarantined")
public @interface Flaky
or
@Tag("flaky")
public @interface Flaky
WDYT?
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.
@tag("flaky")
public @interface Flaky
I prefer this one since it’s shorter and has been part of Kafka for a long time.
Since we're defining this new task separately, we have some flexibility. We can have it fail after some high threshold (like 20 that I arbitrarily chose), or we can prevent it from ever failing the build. In principle, I guess it's best to not fail the build and rely on the quarantined test reports to ensure we don't accumulate too many quarantined tests or have them for too long. |
Introduce new quarantinedTest that excludes tests tagged with "quarantined". Also introduce two new build parameters "maxQuarantineTestRetries" and "maxQuarantineTestRetryFailures".