File tree Expand file tree Collapse file tree
randomizedtesting-jupiter/src/main/java/com/carrotsearch/randomizedtesting/jupiter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626- can we enforce the order of extensions (randomized testing > leaked threads)
2727- how are jupiter timeouts working together with leaked threads ext.?
2828- maybe bring back thread leak zombies annotation (if we can't cleanly terminate leaked threads, ignore all remaining tests).
29+ - maybe move some of the implementation details to a non-exposed package?
30+ - regenerate the javadocs with public API only.
Original file line number Diff line number Diff line change 11package com .carrotsearch .randomizedtesting .jupiter ;
22
3+ /** A single randomization seed (typically part of a larger {@link SeedChain}). */
34public record Seed (long value ) {
45 private static final char [] HEX = "0123456789ABCDEF" .toCharArray ();
56 static final Seed UNSPECIFIED = new Seed (0 );
Original file line number Diff line number Diff line change 22
33import java .util .List ;
44import java .util .Locale ;
5- import java .util .Random ;
65import java .util .stream .Collectors ;
76import java .util .stream .Stream ;
87
9- record SeedChain (List <Seed > seeds ) {
8+ /**
9+ * A seed chain determines randomization if {@link Randomized} extension is used. A seed chain is a
10+ * sequence of {@link Seed}s, typically associated with one or more hierarchical junit jupiter
11+ * contexts.
12+ */
13+ public record SeedChain (List <Seed > seeds ) {
1014 private static final SeedChain EMPTY = new SeedChain (List .of ());
1115
1216 static SeedChain parse (String chain ) {
@@ -37,7 +41,7 @@ public String toString() {
3741
3842 record FirstAndRest (Seed first , SeedChain rest ) {}
3943
40- public FirstAndRest pop () {
44+ FirstAndRest pop () {
4145 if (seeds .isEmpty ()) {
4246 return new FirstAndRest (Seed .UNSPECIFIED , SeedChain .EMPTY );
4347 }
@@ -46,8 +50,4 @@ public FirstAndRest pop() {
4650 var rest = new SeedChain (seeds .subList (1 , seeds .size ()));
4751 return new FirstAndRest (first , rest );
4852 }
49-
50- private long nextRandomValue () {
51- return new Random ().nextLong ();
52- }
5353}
Original file line number Diff line number Diff line change 44import java .util .regex .Pattern ;
55
66/**
7+ * The default filter containing sane defaults excluding system and ignorable threads when {@link
8+ * DetectThreadLeaks} extension is used.
9+ *
710 * @see DetectThreadLeaks.ExcludeThreads
811 */
912public class SystemThreadFilter implements Predicate <Thread > {
Original file line number Diff line number Diff line change 11package com .carrotsearch .randomizedtesting .jupiter ;
22
3- public final class Threads {
3+ final class Threads {
44 Threads () {}
55
66 /** Collect thread information, JVM vendor insensitive. */
7- public static String threadName (Thread t ) {
7+ static String threadName (Thread t ) {
88 return "Thread["
99 + ("id=" + t .threadId ())
1010 + (", name=" + t .getName ())
You can’t perform that action at this time.
0 commit comments