[ https://issues.apache.org/jira/browse/KAFKA-14461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sagar Rao updated KAFKA-14461: ------------------------------ 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. was: `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. > StoreQueryIntegrationTest#shouldQuerySpecificActivePartitionStores logic to > check for active partitions seems brittle. > ---------------------------------------------------------------------------------------------------------------------- > > Key: KAFKA-14461 > URL: https://issues.apache.org/jira/browse/KAFKA-14461 > Project: Kafka > Issue Type: Bug > Reporter: Sagar Rao > Assignee: Sagar Rao > Priority: Major > > `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. > -- This message was sent by Atlassian Jira (v8.20.10#820010)