Skip to content

Commit

Permalink
fix: add better annotation
Browse files Browse the repository at this point in the history
Signed-off-by: Zhangjian He <[email protected]>
  • Loading branch information
hezhangjian committed Jan 13, 2025
1 parent ff2eddd commit c0b03e5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,30 @@
import org.junit.jupiter.api.Test;

/**
* Intended for marking a test case as flaky.
* Annotation to mark a test as flaky.
*
* <p>Flaky tests are tests that produce inconsistent results,
* occasionally failing or passing without changes to the code under test.
* This could be due to external factors such as timing issues, resource contention,
* dependency on non-deterministic data, or integration with external systems.
*
* <p>Tests marked with this annotation are excluded from execution
* in CI pipelines and Maven commands by default, to ensure a reliable and
* deterministic build process. However, they can still be executed manually
* or in specific environments for debugging and resolution purposes.
*
* <p>Usage:
* <pre>
* {@code
* @FlakyTest
* public void testSomething() {
* // Test logic here
* }
* }
* </pre>
*
* <p>It is recommended to investigate and address the root causes of flaky tests
* rather than relying on this annotation long-term.
*/
@Documented
@Target({ ElementType.TYPE, ElementType.METHOD })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public void testNoSuchLedgerExists() throws Exception {
}

/**
* Test that if a empty ledger loses the bookie not in the quorum for entry 0, it will
* Test that if an empty ledger loses the bookie not in the quorum for entry 0, it will
* still be openable when it loses enough bookies to lose a whole quorum.
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.bookkeeper.stats.NullStatsLogger;
import org.apache.distributedlog.DistributedLogConfiguration;
import org.apache.distributedlog.common.config.PropertiesWriter;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

Expand Down

0 comments on commit c0b03e5

Please sign in to comment.