3967 |
|
List<CompletionStage<Integer>> stages = new ArrayList<>(); |
3968 |
|
stages.add(new CompletableFuture<Integer>().minimalCompletionStage()); |
3969 |
|
stages.add(CompletableFuture.completedStage(1)); |
3970 |
+ |
stages.add(CompletableFuture.failedStage(new CFException())); |
3971 |
|
|
3972 |
|
List<Method> bugs = new ArrayList<>(); |
3973 |
|
for (Method method : allMethods) { |
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 |
|
*/ |
4248 |
– |
|
4249 |
– |
/** 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 |