Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ConcurrentModificationException in AbstractRequestExpectationManager [SPR-15029] #19596
We are using MockRestServiceServer in conjunction with expectations to conduct testing of our Spring application.
We have noticed that when a method under test invokes asynchronous network requests the MockRestServiceServer will occasionally throw a ConcurrentModificationException causing the test to fail. The issue is observed when using parallelStream() as well as other asynchronous methods. Reintroducing concurrency alleviates the issue.
Please find attached a trivial Spring Boot application that reproduces this issue.
Affects: 4.2.4, 4.3.4
Rossen Stoyanchev commented
Stack trace from given example: