Affects: 5.3.29


We have a project in Spring Boot (version 2.7.14) that is extensively tested and we noticed that at some point some of our tests start failing without apparent reason.

I could boil down the issue into a sample project as seen here. Run the whole test suite and the last service test will fail but it shouldn't.

After digging into the details you can find that after DefaultContextCache.this.remove(eldest.getKey(), HierarchyMode.CURRENT_LEVEL) is called within removeEldestEntry() in LruCache then something happens that makes Wiremock server to behave instable.

If we replace this logic to not remove an element but to reset the whole cache then all tests will be green. This workaround is found here.


It is not obvious to me if this is a Spring framework issue or a WireMock issue indeed. I created a sibling ticket accordingly.

Comment From: sbrannen

It is not obvious to me if this is a Spring framework issue or a WireMock issue indeed. I created a sibling ticket accordingly.

Having only glanced at this issue, I would guess that the issue is related to Spring Cloud Contract WireMock and perhaps not directly to the core WireMock project itself.

Comment From: sbrannen

@rszabolcs, please raise this issue with the Spring Cloud Contract team.