KAFKA-6145: KIP-441: fix flaky shouldEnforceRebalance test in StreamThreadTest (#8452)

Reviewers: Boyang Chen <boyang@confluent.io>, John Roesler <vvcephei@apache.org>
This commit is contained in:
A. Sophie Blee-Goldman 2020-04-09 15:28:44 -07:00 committed by GitHub
parent bf6dffe93b
commit 0470e2bc95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -508,13 +508,16 @@ public class StreamThreadTest {
10 * 1000, 10 * 1000,
"Thread never started."); "Thread never started.");
TestUtils.retryOnExceptionWithTimeout(
() -> EasyMock.verify(mockConsumer)
);
thread.shutdown(); thread.shutdown();
TestUtils.waitForCondition( TestUtils.waitForCondition(
() -> thread.state() == StreamThread.State.DEAD, () -> thread.state() == StreamThread.State.DEAD,
10 * 1000, 10 * 1000,
"Thread never shut down."); "Thread never shut down.");
EasyMock.verify(mockConsumer);
} }
private static class EasyMockConsumerClientSupplier extends MockClientSupplier { private static class EasyMockConsumerClientSupplier extends MockClientSupplier {