kafka-ui
kafka-ui copied to clipboard
BE: Fix KafkaConsumerGroupTests on Windows
- [ ] Breaking change? (if so, please describe the impact and migration path for existing application instances)
What changes did you make? (Give an overview)
shouldOkWhenConsumerGroupIsNotActive was returning a 400 instead of a 200 without the try with resources block, once I added it, the test consistently passes. Additionally removed some unused variables and used toList() added with JDK 17.
Is there anything you'd like reviewers to focus on?
How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)
- [ ] No need to
- [ ] Manually (please, describe, if necessary)
- [ ] Unit checks
- [ ] Integration checks
- [x] Covered by existing automation
Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
- [ ] My changes generate no new warnings (e.g. Sonar is happy)
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged
Check out Contributing and Code of Conduct
A picture of a cute animal (not mandatory but encouraged)
Hi, @busches. Thanks for your contribution! Looks nice! @iliax don't you mind to review it?
@busches your changes looks fine, but I can't understand how they can fix tests on windows) Can you please add more context here and describe why this is working now?
Further user feedback is requested. Please reply within 7 days or we might close the issue.
What the code change does is ensure that the Consumer Group is cleaned up, with the try with resources, before it executes the API request. The same is true for the other test, where we leave the Consumer Group up until after the API request. That test did not have any issues passing for me, but I changed it to mirror the other for self documenting purposes.
The issue may not be related to Windows at all, but that's what I'm running. It could be a case of my computer is too slow to remove the consumer group fully before the API request runs or potentially something with my JDK, I was using Oracle and will swap to Termium tonight. Note: there were three failing test suites I encountered, this one, one for the Protobuf stuff (unsure of the cause) and another that is 100% OS line endings that I'll fix next.
Thanks for the additional feedback! We'll get back to your issue soon.
I don't personally mind a few try with resources here even if they don't fix anything as long as it's not PR spam. @busches is there anything else you'd like to add up to this PR or should I merge it?
@Haarolean I would like to fix the other test failures I'm seeing on Windows, but no ETA on when I can get them in :)
Everything is passing now on Windows. I didn't like that I had to change ProtobufFileSerde, the other option is to change the test files to not be nested in the language folder.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Thanks for a contribution and sorry for the delay