We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description When code contains usage of CompletableFuture Fuzzer may generate tests which throw unexpected exception during execution.
CompletableFuture
To Reproduce
examples.threads.FutureExamples#changingCollectionInFutureWithoutGet
Expected behavior Tests without exception pass
Actual behavior Half of generated tests fail.
Screenshots, logs Code under test
public int changingCollectionInFutureWithoutGet() { List<Integer> values = new ArrayList<>(); final CompletableFuture<Void> future = CompletableFuture.runAsync(() -> values.add(42)); return values.get(0); }
One of generated tests:
@Test @DisplayName("changingCollectionInFutureWithoutGet: -> return 42") public void testChangingCollectionInFutureWithoutGetReturns42() { FutureExamples futureExamples = new FutureExamples(); int actual = futureExamples.changingCollectionInFutureWithoutGet(); assertEquals(42, actual); }
Exception during execution:
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) at java.base/java.util.Objects.checkIndex(Objects.java:372) at java.base/java.util.ArrayList.get(ArrayList.java:459) at examples.threads.FutureExamples.changingCollectionInFutureWithoutGet(FutureExamples.java:41) at examples.threads.FutureExamplesTest.testChangingCollectionInFutureWithoutGetReturns42(FutureExamplesTest.java:23)
Additional context Symbolic engine doesn't generate tests which should pass.
The text was updated successfully, but these errors were encountered:
Markoutte
No branches or pull requests
Description
When code contains usage of
CompletableFuture
Fuzzer may generate tests which throw unexpected exception during execution.To Reproduce
examples.threads.FutureExamples#changingCollectionInFutureWithoutGet
Expected behavior
Tests without exception pass
Actual behavior
Half of generated tests fail.
Screenshots, logs
Code under test
One of generated tests:
Exception during execution:
Additional context
Symbolic engine doesn't generate tests which should pass.
The text was updated successfully, but these errors were encountered: