Comments (2)
I was dealing with the same issue two weeks ago so I could provide more details. The problem occurs only when adding expectation of type ExpectationResponseCallback
that leads to registration of WebSocketClient
required for reading the request so it can be used for generating response. WebSocketClient
is subscribed to MockServerEventBus
to listen for STOP
and RESET
events. There is a single MockServerEventBus
for each port stored in static final field EVENT_BUS_MAP
within class MockServerClient
. When calling org.mockserver.client.MockServerClient#reset
, RESET
event is propagated to each subscriber but the issue is that subscribers registered within MockServerEventBus
are never cleared, therefore, WebSocketClient
s don't become eligible for garbage collection during the tests run.
In my case I was able to bypass the issue by using the method clear to clear logs and manually remove expectations by ids to avoid calling the reset method. Using org.mockserver.client.ForwardChainExpectation#respond(org.mockserver.mock.action.ExpectationResponseCallback)
is necessary only for expectations that need the ability to read the request and by registering them only once it one can mitigate the problem.
On the other hand, this state is far from ideal and subscribers in MockServerEventBus
could be cleared once the event was propagated to them.
from mockserver.
from mockserver.
Related Issues (20)
- Possible to have early response before consuming request body
- mockserver failed to initialize the server-side SSL context
- Multiple responses for the same request are not thread-safe
- mock-server client does not support TLS v1.3 HOT 2
- How to proxy to mockserver with auth HOT 1
- "SEVERE exception validating JSON" while parsing pathparameter of openapi-generated request matchers HOT 2
- No support for multi-line MUSTACHE templates in initializerJson.json
- Extract current Expectations via API
- jsonschema allOf not managed
- CVE-2023-4911 vulnerability mockserver/mockserver:0.15.0
- Eliminate use of javax.servlet-api
- Support to add Image Pull Secrets for Docker Image
- Where is James ? HOT 1
- Repeated query parameters with the same value are missing from queryStringParameters
- Creating expectations from OpenAPI without components section HOT 1
- docker MockServer on Raspberry PI 4 not working - java exec format error
- JSON String body. Double quotes in verification is ignored/JSON String body unwrapping in verification
- Need some extra pointers on maximizing single instance performance
- Experiencing high latency and CPU utilization when expectations size is large
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mockserver.