Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-14461

StoreQueryIntegrationTest#shouldQuerySpecificActivePartitionStores logic to check for active partitions seems brittle.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • streams, unit tests
    • None

    Description

      StoreQueryIntegrationTest#shouldQuerySpecificActivePartitionStores 

      has a logic to figure out active partitions:

       

       

      final boolean kafkaStreams1IsActive = (keyQueryMetadata.activeHost().port() % 2) == 1;

       

       

      This is very brittle as when a new test gets added, this check would need to be changed to `==0`. It's a hassle to change it everytime with a new test added. Should look to improve this.

      Also, this test relies on junit4 annotations which can be migrated to Junit 5 so that we can use @BeforeAll to set up and @AfterAll to shutdown the cluster instead of the current way where it's being done before/after every test.

       

      Attachments

        Issue Links

          Activity

            People

              sagarrao Sagar Rao
              sagarrao Sagar Rao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: