-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread safety issue with Velocity templates using request scoped tools like $json #1773
Comments
The accessUrl in the output shows the ID of another request in the same second (""{ "accessUrl": "0b77c7cc-c99e-4dfd-99e3-8a7d4646e503"}"}" Having looked through the code, I just cant see how this could be happening right now |
The velocity code is not threadsafe (Mockserver is misusing it, or its a bug, not sure yet). |
Mockserver is not using Velocity in a threadsafe way, as ToolContext is not threadsafe when using request scoped tools. |
Hello, I have been reproducing the issue by using locust against the mockserver I hope it helps Regards |
Funnily enough, I have migrated away from JAVASCRIPT before facing this issue, because it is no longer supported properly. The Docker image uses JDK17 where Nashorn is not present (it is deprecated) |
Describe the issue
We are seeing issues with incorrect response being returned from mockserver
What you are trying to do
We have some velocity templates setup that we are passing in via JSON. We are seeing incorrect values from mockserver which are confirmed by the logs. As you can see this should be impossible based on the template logged.
MockServer version
5.15.0
To Reproduce
Tricky... not sure yet.
How you are running MockServer (i.e maven plugin, docker, etc)
Docker
Code you used to create expectations
TBC
What error you saw
Impossible output given input, shown in logs
Expected behaviour
Consistent output based on template
MockServer Log
Log output, as INFO level (or lower)
As above
The text was updated successfully, but these errors were encountered: