You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initially I raised this issue here and here. Then I was suggested to report it here instead.
Description
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.
Reproduction steps
Run the whole test suite here and the last service test will fail but it shouldn't.
The text was updated successfully, but these errors were encountered:
Hello, thanks for checking it!
I'm not sure this workaround of mine would be a proper solution. I don't fully understand why the workaround works exactly. Somehow WireMock gets screwed when ContextCache is evicted to make it possible to add an element again. When we reset it instead of removing an element, apparently it's working fine. But I wouldn't know why.
Remarks
Initially I raised this issue here and here. Then I was suggested to report it here instead.
Description
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 withinremoveEldestEntry()
inLruCache
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.
Reproduction steps
Run the whole test suite here and the last service test will fail but it shouldn't.
The text was updated successfully, but these errors were encountered: