You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "mumrah (via GitHub)" <gi...@apache.org> on 2025/02/06 15:46:52 UTC
Re: [PR] KAFKA-18748 Run new tests separately in PRs [kafka]
mumrah commented on code in PR #18770:
URL: https://github.com/apache/kafka/pull/18770#discussion_r1944962641
##########
test-common/test-common-util/src/main/java/org/apache/kafka/common/test/junit/QuarantinedPostDiscoveryFilter.java:
##########
@@ -41,42 +41,62 @@ public class QuarantinedPostDiscoveryFilter implements PostDiscoveryFilter {
public static final String RUN_QUARANTINED_PROP = "kafka.test.run.quarantined";
+ public static final String RUN_FLAKY_PROP = "kafka.test.run.flaky";
+
public static final String CATALOG_FILE_PROP = "kafka.test.catalog.file";
private final Filter<TestDescriptor> autoQuarantinedFilter;
+
private final boolean runQuarantined;
+ private final boolean runFlaky;
+
// No-arg public constructor for SPI
@SuppressWarnings("unused")
public QuarantinedPostDiscoveryFilter() {
runQuarantined = System.getProperty(RUN_QUARANTINED_PROP, "false")
.equalsIgnoreCase("true");
+ runFlaky = System.getProperty(RUN_FLAKY_PROP, "false")
+ .equalsIgnoreCase("true");
+
String testCatalogFileName = System.getProperty(CATALOG_FILE_PROP);
autoQuarantinedFilter = AutoQuarantinedTestFilter.create(testCatalogFileName, runQuarantined);
}
// Visible for tests
- QuarantinedPostDiscoveryFilter(Filter<TestDescriptor> autoQuarantinedFilter, boolean runQuarantined) {
+ QuarantinedPostDiscoveryFilter(
+ Filter<TestDescriptor> autoQuarantinedFilter,
+ boolean runQuarantined,
+ boolean runFlaky
+ ) {
this.autoQuarantinedFilter = autoQuarantinedFilter;
this.runQuarantined = runQuarantined;
+ this.runFlaky = runFlaky;
}
@Override
public FilterResult apply(TestDescriptor testDescriptor) {
boolean hasTag = testDescriptor.getTags().contains(FLAKY_TEST_TAG);
FilterResult result = autoQuarantinedFilter.apply(testDescriptor);
- if (runQuarantined) {
- // If selecting quarantined tests, we first check for explicitly flaky tests. If no
- // flaky tag is set, check the auto-quarantined filter. In the case of a missing test
- // catalog, the auto-quarantined filter will exclude all tests.
+
+ if (runFlaky && runQuarantined) {
Review Comment:
It is unreachable with our current configuration, but since it is possible to hit this I figured we should support it in code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org