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? |
| 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.
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.
|
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 |
chia7712
left a comment
There was a problem hiding this comment.
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
|
|
||
| useJUnitPlatform { | ||
| includeEngines 'junit-jupiter' | ||
| excludeTags 'quarantined' |
There was a problem hiding this comment.
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.
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.
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.
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.
@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 "flaky". Also introduce two new build parameters "maxQuarantineTestRetries" and "maxQuarantineTestRetryFailures". Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
Introduce new quarantinedTest that excludes tests tagged with "quarantined". Also introduce two new build parameters "maxQuarantineTestRetries" and "maxQuarantineTestRetryFailures".