Skip to content
New issue

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

ResourcePathTypeResolver is not threadsafe #1003

Closed
tschlat opened this issue Sep 26, 2023 · 1 comment · Fixed by #1004
Closed

ResourcePathTypeResolver is not threadsafe #1003

tschlat opened this issue Sep 26, 2023 · 1 comment · Fixed by #1004

Comments

@tschlat
Copy link
Collaborator

tschlat commented Sep 26, 2023

Citrus Version
4.0

Expected behavior
Tests can be executed in parallel.

Actual behavior
Parallel test execution fails non deterministically because auf ConcurrentModificationException.

Stacktrace

java.util.ConcurrentModificationException at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1631) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310) at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) at org.citrusframework.spi.ResourcePathTypeResolver.resolveAll(ResourcePathTypeResolver.java:117) at org.citrusframework.spi.TypeResolver.resolveAll(TypeResolver.java:75) at org.citrusframework.spi.TypeResolver.resolveAll(TypeResolver.java:63) at org.citrusframework.spi.TypeResolver.resolveAll(TypeResolver.java:52)

@tschlat
Copy link
Collaborator Author

tschlat commented Sep 26, 2023

The problem here is the new array:

private final List<String> zipEntriesAsString = new ArrayList<>();

Access to this array is not synchronized.

@tschlat tschlat linked a pull request Sep 26, 2023 that will close this issue
bbortt added a commit that referenced this issue Sep 27, 2023
…zip_entries_array

fix(#1003): Synchronize access to the zipEntries array cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant