-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add methods to verify service invocation #121
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
feat: add methods to verify service invocation #121
Conversation
|
Welcome to the Microcks community! 💖 Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly. Hope you have a great time there! |
|
Hello If the unit test code calls the Microcks Metrics REST API too quickly after the desired service have been invoked, randomly (about 1 time out of 2) the API responds as if the service wasn't invoked. @lbroudoux and Microcks community : have you ever heard of this kind of issue with Microcks Metrics REST API ? You will find this code, calling |
|
Hi @pierrechristinimsa Regarding the race condition you're facing: this is expected as the processing of invocation metrics (association to correct day/time and increment of the counter in the database) is done in an asynchronous way vs. the mock controller. I think that adding a timer cannot be avoided to fix the race condition... I just wonder if it wouldn't be better to put this directly in the library method to avoid the consumer worrying about this... 🤔 |
Thank you for your reactive answer and explanations @lbroudoux. I think that's what I've done : the sleep is hard-coded inside the library method, so the consumer shouldn't be aware of this. I would have liked to make this sleep time possibly configurable, but as I'm not used to do this, I didn't manage to do this simply. By the way, I remove the "Draft" state of this PR and I remain available to make some changes if needed. |
src/test/java/io/github/microcks/testcontainers/MicrocksContainerTest.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/microcks/testcontainers/MicrocksContainer.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/microcks/testcontainers/model/DailyInvocationStatistic.java
Show resolved
Hide resolved
lbroudoux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @pierrechristinimsa!
This looks very good - I just suggested a few changes to stick to coding style or governance issues. Nice job!
Signed-off-by: Pierre CHRISTIN <christin.pierre@imsa.msa.fr>
lbroudoux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look all good to me! I will double-check the question of encoding. Thanks again!
|
You are now a Microcks community contributor! 💖 Thanks and congrats 🚀 on merging your first pull request! We are delighted and very proud of you! 👏 📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact. If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌" Kudos and please keep going, we need you 🙌 |
Description
Thread.sleep(...)to avoid race condition issue with the Metrics REST API.It still lacks of more detailed results.
For instance, for SOAP Mock: it is still impossible to know exactly the count of invocations for a given Operation of the mocked Service. But that doesn't seem to be managed by the microcks server itself, or at least not exposed by the Metrics REST API.
I would also have liked to make the sleep time possibly configurable, but didn't manage to do this simply.
Please feel free to bring feedbacks, thanks by advance.
Related issue(s)
See also #91