Context
The file-similarity tool on PR #34 flagged MockConsumerTestWithCommitTimeoutException and MockConsumerTestWithEarlyClose at 70.7% similarity (up from 65.1% after applying the same daemon-thread cleanup pattern to both).
More broadly, the test codebase has several standalone test classes (MockConsumerTest*, ProducerManagerTest) that duplicate infrastructure that could be shared.
Scope
-
MockConsumer tests*: Extract common setup (mock consumer creation, record-adder daemon thread, PC lifecycle, cleanup) into a shared base class or helper. Each test overrides only the failure behaviour and assertion.
-
General test deduplication audit: Review the file-similarity report for other high-similarity pairs in src/test/ and src/test-integration/ and refactor where the duplication is structural (not just "similar test shape").
Not blocking
The 70.7% is within the fail_above: 80 threshold. This is cleanup work, not urgent.
Surfaced during PR #34 CI reliability work.
Context
The file-similarity tool on PR #34 flagged
MockConsumerTestWithCommitTimeoutExceptionandMockConsumerTestWithEarlyCloseat 70.7% similarity (up from 65.1% after applying the same daemon-thread cleanup pattern to both).More broadly, the test codebase has several standalone test classes (MockConsumerTest*, ProducerManagerTest) that duplicate infrastructure that could be shared.
Scope
MockConsumer tests*: Extract common setup (mock consumer creation, record-adder daemon thread, PC lifecycle, cleanup) into a shared base class or helper. Each test overrides only the failure behaviour and assertion.
General test deduplication audit: Review the file-similarity report for other high-similarity pairs in
src/test/andsrc/test-integration/and refactor where the duplication is structural (not just "similar test shape").Not blocking
The 70.7% is within the
fail_above: 80threshold. This is cleanup work, not urgent.Surfaced during PR #34 CI reliability work.