Github user srdo commented on a diff in the pull request: https://github.com/apache/storm/pull/1924#discussion_r107547996 --- Diff: external/storm-kafka-client/src/test/java/org/apache/storm/kafka/spout/SingleTopicKafkaSpoutTest.java --- @@ -266,4 +269,36 @@ public void shouldReplayFirstTupleFailedOutOfOrder() throws Exception { verifyAllMessagesCommitted(messageCount); } } + + @Test + public void shouldReplayAllFailedTuplesWhenFailedOutOfOrder() throws Exception { + int messageCount = 10; + initializeSpout(messageCount); + + //play all tuples + for (int i = 0; i < messageCount; i++) { + spout.nextTuple(); + } + ArgumentCaptor<KafkaSpoutMessageId> messageIds = ArgumentCaptor.forClass(KafkaSpoutMessageId.class); + verify(collector, times(messageCount)).emit(anyObject(), anyObject(), messageIds.capture()); + reset(collector); + //Fail tuple 5 and 3, call nextTuple, then fail tuple 2 + List<KafkaSpoutMessageId> capturedMessageIds = messageIds.getAllValues(); + spout.fail(capturedMessageIds.get(5)); + spout.fail(capturedMessageIds.get(3)); + spout.nextTuple(); --- End diff -- Basically I wanted to test that the spout will emit each retriable tuple exactly once, even if the tuples fail in a weird order or Storm asks for more tuples in the middle of the failures. Added a comment to the test.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---