-
Notifications
You must be signed in to change notification settings - Fork 14.7k
KAFKA-19345: Use ShareFetchUtils mock for DelayedShareFetchTest tests #20765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
| assertNull(shareGroupMetrics.topicPartitionsFetchRatio(groupId)); | ||
|
|
||
| delayedShareFetch.lock().unlock(); | ||
| Mockito.verify(exceptionHandler, never()).accept(any(), any()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exceptionHandler shouldn't be triggered in this test case.
The reason it throw error simply due to incorrect test mock up,
| when(replicaManager.getPartitionOrException(tp0.topicPartition())).thenReturn(p0); |
replicaManager.getPartitionOrException(tp0.topicPartition()) defined in | mockTopicIdPartitionFetchBytes(replicaManager, tp0, hwmOffsetMetadata); |
| exceptionHandler.accept( |
| assertTrue(delayedShareFetch.lock().tryLock()); | ||
| delayedShareFetch.lock().unlock(); | ||
| Mockito.verify(exceptionHandler, times(1)).accept(any(), any()); | ||
| Mockito.verify(exceptionHandler, never()).accept(any(), any()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
|
UserQuotaTest#testThrottledRequest(String) with groupProtocol=classic is a known flaky test (KAFKA-8459). It’s unrelated to this PR and passes locally. |
|
Gentle ping , @AndrewJSchofield, @apoorvmittal10, @adixitconfluent — sorry for the late implementation 🙏 |
|
@adixitconfluent Can you please review the PR. |
This patch wraps ShareFetchUtils static method
processFetchResponsewith MockedStatic to improve test isolation and also fixes some
incorrect test results.