Coder Social home page Coder Social logo

Comments (2)

lnevaril avatar lnevaril commented on June 14, 2024 1

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, WebSocketClients 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.

1534196496 avatar 1534196496 commented on June 14, 2024

image

from mockserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.