4242 |
|
} |
4243 |
|
} |
4244 |
|
|
4245 |
< |
/* |
4246 |
< |
* Tests below currently fail in stress mode due to memory retention. |
4247 |
< |
* ant -Dvmoptions=-Xmx8m -Djsr166.expensiveTests=true -Djsr166.tckTestClass=CompletableFutureTest tck |
4245 |
> |
/** |
4246 |
> |
* Checks for garbage retention with anyOf. |
4247 |
> |
* Following used to fail with OOME: |
4248 |
> |
* ant -Dvmoptions=-Xmx8m -Djsr166.expensiveTests=true -Djsr166.tckTestClass=CompletableFutureTest -Djsr166.methodFilter=testAnyOfGarbageRetention tck |
4249 |
|
*/ |
4249 |
– |
|
4250 |
– |
/** Checks for garbage retention with anyOf. */ |
4250 |
|
public void testAnyOfGarbageRetention() throws Throwable { |
4251 |
|
for (Integer v : new Integer[] { 1, null }) |
4252 |
|
{ |
4260 |
|
checkCompletedNormally(CompletableFuture.anyOf(fs), v); |
4261 |
|
}} |
4262 |
|
|
4263 |
< |
/** Checks for garbage retention with allOf. */ |
4263 |
> |
/** |
4264 |
> |
* Checks for garbage retention with allOf. |
4265 |
> |
* |
4266 |
> |
* As of 2016-07, fails with OOME: |
4267 |
> |
* ant -Dvmoptions=-Xmx8m -Djsr166.expensiveTests=true -Djsr166.tckTestClass=CompletableFutureTest -Djsr166.methodFilter=testCancelledAllOfGarbageRetention tck |
4268 |
> |
*/ |
4269 |
|
public void testCancelledAllOfGarbageRetention() throws Throwable { |
4270 |
|
final int n = expensiveTests ? 100_000 : 10; |
4271 |
|
CompletableFuture<Integer>[] fs |