kafka-ui icon indicating copy to clipboard operation
kafka-ui copied to clipboard

BE: Fix KafkaConsumerGroupTests on Windows

Open busches opened this issue 1 year ago • 9 comments

  • [ ] 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)

busches avatar Apr 02 '24 03:04 busches

Hi, @busches. Thanks for your contribution! Looks nice! @iliax don't you mind to review it?

germanosin avatar Apr 02 '24 06:04 germanosin

@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?

iliax avatar Apr 02 '24 07:04 iliax

Further user feedback is requested. Please reply within 7 days or we might close the issue.

kapybro[bot] avatar Apr 02 '24 07:04 kapybro[bot]

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.

busches avatar Apr 02 '24 13:04 busches

Thanks for the additional feedback! We'll get back to your issue soon.

kapybro[bot] avatar Apr 02 '24 13:04 kapybro[bot]

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 avatar Apr 02 '24 14:04 Haarolean

@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 :)

busches avatar Apr 02 '24 14:04 busches

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.

busches avatar Apr 03 '24 02:04 busches

Thanks for a contribution and sorry for the delay

Haarolean avatar Aug 01 '24 17:08 Haarolean