dino2895 opened a new pull request, #23375:
URL: https://github.com/apache/kafka/pull/23375

   This PR moves `AllocateProducerIdsRequestTest` from the `core` module to
   the `server` module and rewrites it in Java, following the ongoing
   Scala-to-Java migration. `ClusterInstance` already provides everything
   the test needs, so no new test infrastructure is required.
   
   ### Changes
   
   - Rewrite the two existing cases with `ClusterInstance` and
     `@ClusterTest`. The active controller is located through
     `controller().isActive()` instead of the broker's Raft client.
   - Fix the typo in the test names (`ProducersId` -> `ProducerIds`) and
     rename `SentToNonController` to `SentToStandbyController`.
   - Add coverage for the remaining paths of `handleAllocateProducerIdsRequest`:
     - `testAllocateProducerIdsWithInvalidBrokerEpoch` and
       `testAllocateProducerIdsWithUnknownBroker` verify the
       `STALE_BROKER_EPOCH` responses, and that a rejected request does not
       consume a block.
     - `testAllocateProducerIdsAfterControllerFailover` verifies that the
       new active controller does not hand out a block that the previous
       controller already allocated.
     - `testAllocateProducerIdsAfterBrokerRestart` verifies that the epoch
       from before a restart is rejected while the new epoch continues the
       sequence.
   - Remove the Scala test.
   
   This is a test-only change with no intended behavior change.
   
   ### Testing
   
   ```bash
   ./gradlew :server:checkstyleTest :server:spotlessCheck \
     :core:compileTestScala \
     :server:test --tests org.apache.kafka.server.AllocateProducerIdsRequestTest


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to