mountebank issue when the mock is >35000 line
I have written a mock in mountebank which is something like below:
{
"predicates": [
{
"equals": {
"method": "GET",
"path": "/api/XXXXXX"
}
}
],
"responses": [
{
"is": {
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
},
"body":{
/// the body is too big and spans multiple line i.e around 38000 lines of code is present when the respective api is hit
}
}
The issue is the mountebank is taking too long to respond which results in failure of the test Is there any way to wait until we get response back from mountebank?
Expected behaviour
The mountebank should respond with the status code and the BIG body. ...
Actual behaviour
Mountbank is taking too long to respond which result in failure of my Test scenario
Steps to reproduce
Create a big mock with > 35000 lines in the body of mock
Software versions used
using docker compose to spin the mountebank container
OS : window
mountebank : v2.2.1
node.js : v15.10.0
(only if installed via npm)
Installation method : npm
(npm, zip, tar, pkg, deb, rpm)
Log contents in mb.log when running mb --loglevel debug
Log contents here
It seems the mountebank is taking some time to respond which results in failure of the tests. Is there any way to wait till mountebank respond for a specific endpoint. It seems due to too many parallel hits and big body,the mountebank is taking some time to respond.
Also i can see the below logs ,the total difference is 4 sec from the time the connection is established and the time the connection is closed.
{"message":"[https:443] ::ffff:172.22.0.10:58636 ESTABLISHED","level":"debug","timestamp":"2022-09-07T13:35:40.617Z"}
..
..
..
{"message":"[https:443] ::ffff:172.22.0.10:58636 CLOSED","level":"debug","timestamp":"2022-09-07T13:35:44.028Z"}
also while debugging getting the Processing time as 173. I hope its in seconds?
"processingTime": 173
}
],
"_links": {
"self": {
"href": "/imposters/443/stubs/39"
}
}
seems like for this one we have a performance issue PR already raised https://github.com/bbyars/mountebank/pull/696 @bbyars are you planning to merge this one soon?
Hi there, If I've understood correctly, there are two problems:
- mountebank is taking a long time to respond for large payloads
- The system under test calling mountebank is timing out waiting for the response
#1 requires some investigation, but #2 should be solvable in your code, not mountebank's, no?
On Wed, Sep 7, 2022 at 8:11 AM om prakash mishra @.***> wrote:
It seems the mountebank is taking some time to respond which results in failure of the tests. Is there any way to wait till mountebank respond for a specific endpoint. It seems due to too many parallel hits and big body,the mountebank is taking some time to respond.
— Reply to this email directly, view it on GitHub https://github.com/bbyars/mountebank/issues/697#issuecomment-1239370907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARFP2EZMO22DIP7OCTWNTV5CIAVANCNFSM6AAAAAAQGYFVMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
The #2, i am working on the code and but i am seeing the #1 which might be due to mountebank loading all the mocks in memory and if the payload is quite big takes time to respond.While running the mb in debug mode i can see the response taking more time. I have used the data-dir option to load the mocks from a directory.looking if that solves the problem
This can be closed as the issue seems to be fixed from our side.