-
Notifications
You must be signed in to change notification settings - Fork 15
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
chore: reduce time spent in Quarkus tests #1076
Conversation
While I agree you should stay compatible with the minor request by the Operator SDK extension, I don't think it's a good idea to stay on the micro as you are missing all the fixes we are pushing since at the moment the version used here is 3.17.0. So my advice is: update to the latest micro of the minor branch requested for the Operator SDK. This is important for project-ncl#1076 as otherwise, you will have to wait a lot longer to get the fix. Also it's good practice in general.
While I agree you should stay compatible with the minor request by the Operator SDK extension, I don't think it's a good idea to stay on the micro as you are missing all the fixes we are pushing since at the moment the version used here is 3.17.0. So my advice is: update to the latest micro of the minor branch requested for the Operator SDK. This is important for project-ncl#1076 as otherwise, you will have to wait a lot longer to get the fix. Also it's good practice in general.
While I agree you should stay compatible with the minor requested by the Operator SDK extension, I don't think it's a good idea to stay on the micro as you are missing all the fixes we are pushing since at the moment the version used here is 3.17.0. So my advice is: update to the latest micro of the minor branch requested for the Operator SDK. This is important for project-ncl#1076 as otherwise, you will have to wait a lot longer to get the fix. Also it's good practice in general.
FWIW I also created fabric8io/kubernetes-client#6750 . I worked around the issue but it would be nice to have a proper fix. |
While I agree you should stay compatible with the minor requested by the Operator SDK extension, I don't think it's a good idea to stay on the micro as you are missing all the fixes we are pushing since at the moment the version used here is 3.17.0. So my advice is: update to the latest micro of the minor branch requested for the Operator SDK. This is important for project-ncl#1076 as otherwise, you will have to wait a lot longer to get the fix. Also it's good practice in general.
Some background: Quarkus is restarted whenever a test resource is restricted to the class or different from the ones from other tests and also when the test profile is different. There is a clever orderer in Quarkus that tries to order things cleverly to minimize the number of restarts but... ITs and Failsafe are not honoring the JUnit test orderer so you lose this benefit and you end up with Quarkus being restarted a lot more often than strictly necessary. So the first fix here is to consider the Quarkus tests as Surefire tests, not failsafe tests. If more practical for you, they can be isolated in a specific Surefire execution but we should keep them executed with Surefire. Second issue is that @WithKubernetesTestServer is restricted to a given test clean, meaning every time you have this annotation, the server will have to be restarted. I will start discussions to see if we should change that but in the meantime I added an annotation that has a less aggressive behavior. Unfortunately, you are also affected by a Quarkus bug, for which I will push a fix soon and that we will hopefully backport to the next 3.17.
That means that the tests are not isolated from this POV but Marek was saying this would be OK.
27b405f
to
c54a484
Compare
assertNull(mockServer.getLastRequest()); | ||
// there is no proper way to reset the last request at the beginning of the method | ||
// so let's just compare it's the same as before and no requests have been executed. | ||
assertSame(lastRequestPriorToExecution, mockServer.getLastRequest()); |
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.
I created fabric8io/kubernetes-client#6750 for that.
While I agree you should stay compatible with the minor requested by the Operator SDK extension, I don't think it's a good idea to stay on the micro as you are missing all the fixes we are pushing since at the moment the version used here is 3.17.0. So my advice is: update to the latest micro of the minor branch requested for the Operator SDK. This is important for #1076 as otherwise, you will have to wait a lot longer to get the fix. Also it's good practice in general.
FYI, I'm currently releasing Quarkus 3.17.6 that will come with the Quarkus fix that should improve things for you even more with this patch. I'll include the upgrade in this PR if not merged by then. |
Thanks for heads-up! I actually plan to merge this one now. I can do the Quarkus upgrade myself once it becomes available, or, if you are so kind, you could create a new PR. Hope this works for you. @gsmet Thanks for the support! |
Works for me, I'll create a PR once 3.17.6 has been released. |
This is a follow up of Marek asking for help here: https://quarkusio.zulipchat.com/#narrow/channel/187030-users/topic/.40QuarkusTest.20best.20practices.20.28multiple.20tests.2C.20slowness.29
From the first commit comment (the second one is just going a step further):
Combined with quarkusio/quarkus#45253 , I was able to reduce the time spent in
service
module testing from4mn30
to1m45
and it should scale a lot better if you don't multiply the combination of resources + test profiles.There's one VERY important caveat though: the Kubernetes mock is shared with all the tests so you need to have this limitation in mind. Marek told me that was acceptable so here we are.