|
1 | 1 | [ai generated overview of junit4 features] |
2 | 2 |
|
3 | | -4. Shuffled test execution order and seed annotations |
4 | | - - @Seed on a class fixes the main seed, making execution fully deterministic |
5 | | - - @Seeds / @Seed on a method pins a per-method seed for regression coverage |
6 | | - while still running once with a fresh random seed |
7 | | - |
8 | | -6. Repeating tests with @Repeat |
9 | | - - @Repeat(iterations = N, useConstantSeed = true) reruns a test N times with |
10 | | - the same seed (verifies determinism or checks if failure is consistent) |
11 | | - - @Repeat(iterations = N, useConstantSeed = false) reruns with a new |
12 | | - pseudo-random seed each time (measures failure frequency) |
13 | | - |
14 | | -8. Timeouts |
15 | | - - Standard JUnit @Test(timeout=N) is honoured |
16 | | - - @Timeout(millis=N) annotation provides an explicit alternative |
17 | | - - Termination sequence: Thread.interrupt() → Thread.stop() → zombie |
18 | | - detection; all attempts are logged with stack traces |
19 | | - |
20 | | -9. Thread-leak detection |
21 | | - - Threads that escape a test's ThreadGroup boundary are killed and cause |
22 | | - a test failure |
23 | | - - Encourages explicit Thread.join() before a test method returns |
24 | | - |
25 | | -10. Lingering threads and advanced thread-leak control |
26 | | - - @ThreadLeakLingering(linger=N) waits up to N ms for stray threads to |
27 | | - finish naturally (useful for Executor pools or other uncontrolled threads) |
28 | | - - Additional annotations for fine-grained policy: |
29 | | - @ThreadLeakScope – suite vs. test scope |
30 | | - @ThreadLeakAction – warn vs. fail |
31 | | - @ThreadLeakZombies – ignore vs. fail on zombie threads |
32 | | - |
33 | 3 | 11. Nightly / scaled tests |
34 | 4 | - @Nightly marks a test that only runs when nightly mode is active |
35 | 5 | (-Dtests.nightly=true) |
36 | | - - scaledRandomIntBetween() and multiplier() scale input sizes based on |
| 6 | + - scaledrandomIntInRange() and multiplier() scale input sizes based on |
37 | 7 | nightly vs. daily mode |
38 | 8 |
|
39 | 9 | 2. RandomizedTest base class and RandomizedContext |
40 | 10 | - Extend RandomizedTest for convenient access to a per-test Random instance |
41 | 11 | - Access the context directly via RandomizedContext.current() |
| 12 | + - Utility methods on RandomizedTest: randomInt(), randomIntInRange(), |
42 | 13 |
|
43 | 14 | 3. Randomized input generation |
44 | | - - Utility methods on RandomizedTest: randomInt(), randomIntBetween(), |
45 | 15 | randomBoolean(), randomFloat(), etc. |
46 | 16 | - Encourages testing over a broad input domain rather than fixed values |
| 17 | + |
| 18 | +* utility rules (require assertions, etc.) |
| 19 | + |
| 20 | +* reproduce-failure line info listener? |
| 21 | + |
| 22 | +[possibly doable with a custom test engine] |
| 23 | + |
| 24 | +- predictably shuffled test execution order |
| 25 | +- blowing up test reps using tests.iters |
| 26 | + |
| 27 | +[to check/ add tests of] |
| 28 | + |
| 29 | +- is the seed stack trace frame injected for leaked threads + randomized testing ext? |
| 30 | +- can we enforce the order of extensions (randomized testing > leaked threads) |
| 31 | +- how are jupiter timeouts working together with leaked threads ext.? |
| 32 | +- maybe bring back thread leak zombies annotation (if we can't cleanly terminate leaked threads, ignore all remaining tests). |
| 33 | +- maybe move some of the implementation details to a non-exposed package? |
| 34 | +- regenerate the javadocs with public API only. |
0 commit comments