-
Notifications
You must be signed in to change notification settings - Fork 14k
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
KAFKA-4649: Improve test coverage GlobalStateManagerImpl #2452
Conversation
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
private void writeCorruptCheckpoint() throws IOException { | ||
final File checkpointFile = new File(stateManager.baseDir(), ProcessorStateManager.CHECKPOINT_FILE_NAME); | ||
try (final FileOutputStream stream = new FileOutputStream(checkpointFile)) { | ||
stream.write("0\n1\nblah".getBytes()); |
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.
Nit: somehow I don't like blah
. Otherwise LGTM
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.
I've got something i can change it to, but you probably won't like that either
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.
LGTM
@@ -379,6 +374,31 @@ public void shouldReleaseLockIfExceptionWhenLoadingCheckpoints() throws Exceptio | |||
} | |||
} | |||
|
|||
@Test(expected = StreamsException.class) | |||
public void shouldThrowStreamsExceptionIfFailedToReadCheckpoints() throws Exception { |
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 the same as shouldThrowStreamsExceptionIfFailedToReadCheckpointedOffsets
?
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.
indeed it is!
@guozhangwang - i've removed the redundant test. Thanks for pointing out |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
retest this please |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
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.
LGTM and merged to trunk.
Add coverage for exception paths in `initialize()` Author: Damian Guy <damian.guy@gmail.com> Reviewers: Eno Thereska, Matthias J. Sax, Guozhang Wang Closes apache#2452 from dguy/kafka-4649
Add coverage for exception paths in
initialize()