Skip to content

Commit

Permalink
HOTFIX: fix broken commit
Browse files Browse the repository at this point in the history
Fixes broken commit for KAFKA-17872
  • Loading branch information
mjsax committed Nov 10, 2024
1 parent 587c3cf commit ad3e34d
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public class StreamTaskTest {

private final MockSourceNode<Integer, Integer> source1 = new MockSourceNode<>(intDeserializer, intDeserializer);
private final MockSourceNode<Integer, Integer> source2 = new MockSourceNode<>(intDeserializer, intDeserializer);
private final MockSourceNode<Integer, Integer> source3 = new MockSourceNode<>(intDeserializer, intDeserializer) {
private final MockSourceNode<Integer, Integer> source3 = new MockSourceNode<Integer, Integer>(intDeserializer, intDeserializer) {
@Override
public void process(final Record<Integer, Integer> record) {
throw new RuntimeException("KABOOM!");
Expand All @@ -178,7 +178,7 @@ public void close() {
throw new RuntimeException("KABOOM!");
}
};
private final MockSourceNode<Integer, Integer> timeoutSource = new MockSourceNode<>(intDeserializer, intDeserializer) {
private final MockSourceNode<Integer, Integer> timeoutSource = new MockSourceNode<Integer, Integer>(intDeserializer, intDeserializer) {
@Override
public void process(final Record<Integer, Integer> record) {
throw new TimeoutException("Kaboom!");
Expand Down Expand Up @@ -442,7 +442,7 @@ public void shouldAutoOffsetResetIfNoCommittedOffsetFound() {
task.addPartitionsForOffsetReset(Collections.singleton(partition1));

final AtomicReference<AssertionError> shouldNotSeek = new AtomicReference<>();
try (final MockConsumer<byte[], byte[]> consumer = new MockConsumer<>(OffsetResetStrategy.EARLIEST) {
try (final MockConsumer<byte[], byte[]> consumer = new MockConsumer<byte[], byte[]>(OffsetResetStrategy.EARLIEST) {
@Override
public void seek(final TopicPartition partition, final long offset) {
final AssertionError error = shouldNotSeek.get();
Expand Down Expand Up @@ -2203,6 +2203,7 @@ public void shouldCheckpointOffsetsOnPostCommit() {
when(stateManager.taskId()).thenReturn(taskId);
when(stateManager.taskType()).thenReturn(TaskType.ACTIVE);
final long offset = 543L;
final long consumedOffset = 345L;

when(recordCollector.offsets()).thenReturn(singletonMap(changelogPartition, offset));
when(stateManager.changelogOffsets())
Expand Down Expand Up @@ -2600,7 +2601,6 @@ public void shouldUpdateOffsetIfAllRecordsHaveInvalidTimestamp() {
task.resumePollingForPartitionsWithAvailableSpace();
consumer.poll(Duration.ZERO);
task.addRecords(partition1, records);
task.updateNextOffsets(partition1, new OffsetAndMetadata(offset + 1, Optional.empty(), ""));
task.updateLags();

assertTrue(task.process(offset));
Expand Down Expand Up @@ -2632,7 +2632,6 @@ public void shouldUpdateOffsetIfValidRecordFollowsInvalidTimestamp() {
task.resumePollingForPartitionsWithAvailableSpace();
consumer.poll(Duration.ZERO);
task.addRecords(partition1, records);
task.updateNextOffsets(partition1, new OffsetAndMetadata(offset + 1, Optional.empty(), ""));
task.updateLags();

assertTrue(task.process(offset));
Expand Down Expand Up @@ -2661,8 +2660,6 @@ public void shouldUpdateOffsetIfInvalidTimestampeRecordFollowsValid() {
task.resumePollingForPartitionsWithAvailableSpace();
consumer.poll(Duration.ZERO);
task.addRecords(partition1, records);
task.updateNextOffsets(partition1, new OffsetAndMetadata(offset + 1, Optional.empty(), ""));

task.updateLags();

assertTrue(task.process(offset));
Expand Down

0 comments on commit ad3e34d

Please sign in to comment.