Closed ghost closed 4 years ago
There is no know limitation except the maxExpectations configuration https://mock-server.com/mock_server/configuration_properties.html#button_configuration_max_expectations.
Can you please provide a reproducer so I can test this.
I have been looking into the MockServer code and it seems a maximum limit is set based on the JVM heap memory or the configured maximum limit (5000?), whatever is lower. So I have increased my JVM heap memory from default 256mb to 2GB and the issue seems to persist. Any ideia?
It is easy to reproduce. I simply configure more than a 1000 expectations and and then request the very first one that has been configured. It gives a 404 NotFound.
I use an app (that I did not develop) to configure those mocks, but as far as I understood, it simply converts those json files into the appropiate format to be used by the MockServerClient. I see no reference to configurations, specially to the maximum limit.
Which version of MockServer are you using, as this code in this area was only recently changed.
I believe it is the same as the client, 5.6.1.
After your comments I have decided to give it a couple of tests,
VERSION | RESULT |
---|---|
5.6.1 | NotFound |
5.7.0 | Success |
5.8.0 | Success |
5.9.0 | Success |
5.10.0 | Success |
So I guess the issue has been solved/changed in the meantime and a simple upgrade should solve the issue. I guess this can be closed. What do you say?
yes sounds good I'm going to close the issue, thanks for the update
Describe the issue
It seems that the MockServer can only use the last 1000 expectations configured. Is this true? If it is so, is there any way to increase that?
What you are trying to do
I have created an application that generates the required mocks to our complex environment. It all works well when it generates less than 1000 expectations. If it goes over 1000, some of them (it seems to be the first ones) stop working as the MockServer replies with a 404 NotFound. I have tried to remove some of the expectations to configure less than 1000 and the very same expectations that were not found start to work normally.
MockServer version
5.6.1
To Reproduce Steps to reproduce the issue:
Docker
A Node application that uses the "mockserver-client": "5.6.1"
The MockServer gives no error on configuration (it accepts all the requests). When the MockServer gets requests, expectations older than the 1000th last configured one are NotFound 404.
Expected behaviour
It should use all the expectations configured and not only the last 1000.