658 |
|
LONG_DELAY_MS = SHORT_DELAY_MS * 200; |
659 |
|
} |
660 |
|
|
661 |
+ |
private static final long TIMEOUT_DELAY_MS |
662 |
+ |
= (long) (12.0 * Math.cbrt(delayFactor)); |
663 |
+ |
|
664 |
|
/** |
665 |
< |
* Returns a timeout in milliseconds to be used in tests that |
666 |
< |
* verify that operations block or time out. |
665 |
> |
* Returns a timeout in milliseconds to be used in tests that verify |
666 |
> |
* that operations block or time out. We want this to be longer |
667 |
> |
* than the OS scheduling quantum, but not too long, so don't scale |
668 |
> |
* linearly with delayFactor; we use "crazy" cube root instead. |
669 |
|
*/ |
670 |
< |
long timeoutMillis() { |
671 |
< |
return SHORT_DELAY_MS / 4; |
670 |
> |
static long timeoutMillis() { |
671 |
> |
return TIMEOUT_DELAY_MS; |
672 |
|
} |
673 |
|
|
674 |
|
/** |
1143 |
|
} |
1144 |
|
|
1145 |
|
/** |
1146 |
+ |
* The maximum number of consecutive spurious wakeups we should |
1147 |
+ |
* tolerate (from APIs like LockSupport.park) before failing a test. |
1148 |
+ |
*/ |
1149 |
+ |
static final int MAX_SPURIOUS_WAKEUPS = 10; |
1150 |
+ |
|
1151 |
+ |
/** |
1152 |
|
* The number of elements to place in collections, arrays, etc. |
1153 |
|
*/ |
1154 |
|
public static final int SIZE = 20; |