brandboat commented on code in PR #16783:
URL: https://github.com/apache/kafka/pull/16783#discussion_r1702848944
##########
tools/src/test/java/org/apache/kafka/tools/GetOffsetShellTest.java:
##########
@@ -274,6 +333,45 @@ public void testGetOffsetsByMaxTimestamp() {
}
}
+ @ClusterTemplate("withRemoteStorage")
+ public void testGetOffsetsByEarliestLocalSpec() throws
InterruptedException {
+ setUpRemoteLogTopics();
+
+ for (String time : new String[] {"-4", "earliest-local"}) {
+ TestUtils.waitForCondition(() ->
+ Arrays.asList(
+ new Row("topicRLS1", 0, 0L),
+ new Row("topicRLS2", 0, 1L),
+ new Row("topicRLS3", 0, 2L),
+ new Row("topicRLS4", 0, 3L))
+ .equals(executeAndParse("--topic-partitions",
"topicRLS.*:0", "--time", time)),
+ "testGetOffsetsByEarliestLocalSpec result not match");
+ }
+ }
+
+ @ClusterTemplate("withRemoteStorage")
+ public void testGetOffsetsByLatestTieredSpec() throws InterruptedException
{
+ setUp();
+ setUpRemoteLogTopics();
+
+ for (String time : new String[] {"-5", "latest-tiered"}) {
+ // test topics disable remote log storage
+ // as remote log not enabled, broker return unknown offset for
each topic partition and these
+ // unknown offsets are ignored by GetOffsetShell hence we have
empty result here.
+ assertEquals(Collections.emptyList(),
+ executeAndParse("--topic-partitions", "topic\\d+:0",
"--time", time));
+
+ // test topics enable remote log storage
+ TestUtils.waitForCondition(() ->
+ Arrays.asList(
+ new Row("topicRLS2", 0, 0L),
+ new Row("topicRLS3", 0, 1L),
+ new Row("topicRLS4", 0, 2L))
Review Comment:
Everything has been addressed in the latest commit, thank you
--
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]