-
Notifications
You must be signed in to change notification settings - Fork 15.4k
MINOR: make sure all generated data tests cover all versions #10078
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eddd57f
MINOR: add missed versions to clients tests
chia7712 e1ede6c
Merge branch 'trunk' into MINOR-10078
chia7712 e843e6e
use allVersions
chia7712 ca66a5d
tweak code
chia7712 8d15ee7
Merge branch 'trunk' into MINOR-10078
chia7712 3047e66
tweak code
chia7712 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,7 +186,7 @@ public void testListOffsetsResponseVersions() throws Exception { | |
| .setPartitions(Collections.singletonList(partition))); | ||
| Supplier<ListOffsetsResponseData> response = () -> new ListOffsetsResponseData() | ||
| .setTopics(topics); | ||
| for (short version = 0; version <= ApiKeys.LIST_OFFSETS.latestVersion(); version++) { | ||
| for (short version : ApiKeys.LIST_OFFSETS.allVersions()) { | ||
| ListOffsetsResponseData responseData = response.get(); | ||
| if (version > 0) { | ||
| responseData.topics().get(0).partitions().get(0) | ||
|
|
@@ -459,7 +459,7 @@ public void testOffsetCommitRequestVersions() throws Exception { | |
| )))) | ||
| .setRetentionTimeMs(20); | ||
|
|
||
| for (short version = 0; version <= ApiKeys.OFFSET_COMMIT.latestVersion(); version++) { | ||
| for (short version : ApiKeys.OFFSET_COMMIT.allVersions()) { | ||
| OffsetCommitRequestData requestData = request.get(); | ||
| if (version < 1) { | ||
| requestData.setMemberId(""); | ||
|
|
@@ -485,7 +485,7 @@ public void testOffsetCommitRequestVersions() throws Exception { | |
| if (version == 1) { | ||
| testEquivalentMessageRoundTrip(version, requestData); | ||
| } else if (version >= 2 && version <= 4) { | ||
| testAllMessageRoundTripsBetweenVersions(version, (short) 4, requestData, requestData); | ||
| testAllMessageRoundTripsBetweenVersions(version, (short) 5, requestData, requestData); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we changing this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } else { | ||
| testAllMessageRoundTripsFromVersion(version, requestData); | ||
| } | ||
|
|
@@ -568,7 +568,7 @@ public void testTxnOffsetCommitRequestVersions() throws Exception { | |
| .setCommittedOffset(offset) | ||
| )))); | ||
|
|
||
| for (short version = 0; version <= ApiKeys.TXN_OFFSET_COMMIT.latestVersion(); version++) { | ||
| for (short version : ApiKeys.TXN_OFFSET_COMMIT.allVersions()) { | ||
| TxnOffsetCommitRequestData requestData = request.get(); | ||
| if (version < 2) { | ||
| requestData.topics().get(0).partitions().get(0).setCommittedLeaderEpoch(-1); | ||
|
|
@@ -632,7 +632,7 @@ public void testOffsetFetchVersions() throws Exception { | |
| .setTopics(topics) | ||
| .setRequireStable(true); | ||
|
|
||
| for (short version = 0; version <= ApiKeys.OFFSET_FETCH.latestVersion(); version++) { | ||
| for (short version : ApiKeys.OFFSET_FETCH.allVersions()) { | ||
| final short finalVersion = version; | ||
| if (version < 2) { | ||
| assertThrows(NullPointerException.class, () -> testAllMessageRoundTripsFromVersion(finalVersion, allPartitionData)); | ||
|
|
@@ -661,7 +661,7 @@ public void testOffsetFetchVersions() throws Exception { | |
| .setErrorCode(Errors.UNKNOWN_TOPIC_OR_PARTITION.code()))))) | ||
| .setErrorCode(Errors.NOT_COORDINATOR.code()) | ||
| .setThrottleTimeMs(10); | ||
| for (short version = 0; version <= ApiKeys.OFFSET_FETCH.latestVersion(); version++) { | ||
| for (short version : ApiKeys.OFFSET_FETCH.allVersions()) { | ||
| OffsetFetchResponseData responseData = response.get(); | ||
| if (version <= 1) { | ||
| responseData.setErrorCode(Errors.NONE.code()); | ||
|
|
@@ -720,7 +720,7 @@ public void testProduceResponseVersions() throws Exception { | |
| .setErrorMessage(errorMessage)))).iterator())) | ||
| .setThrottleTimeMs(throttleTimeMs); | ||
|
|
||
| for (short version = 0; version <= ApiKeys.PRODUCE.latestVersion(); version++) { | ||
| for (short version : ApiKeys.PRODUCE.allVersions()) { | ||
| ProduceResponseData responseData = response.get(); | ||
|
|
||
| if (version < 8) { | ||
|
|
@@ -741,9 +741,9 @@ public void testProduceResponseVersions() throws Exception { | |
| } | ||
|
|
||
| if (version >= 3 && version <= 4) { | ||
| testAllMessageRoundTripsBetweenVersions(version, (short) 4, responseData, responseData); | ||
| testAllMessageRoundTripsBetweenVersions(version, (short) 5, responseData, responseData); | ||
| } else if (version >= 6 && version <= 7) { | ||
| testAllMessageRoundTripsBetweenVersions(version, (short) 7, responseData, responseData); | ||
| testAllMessageRoundTripsBetweenVersions(version, (short) 8, responseData, responseData); | ||
| } else { | ||
| testEquivalentMessageRoundTrip(version, responseData); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is not a critical bug as the method
allVersionsis used by testing only.