MINOR: catch InvalidStateStoreException in QueryableStateIntegrationTest
A couple of the tests may transiently fail in QueryableStateIntegrationTest as they are not catching InvalidStateStoreException. This exception is expected during rebalance.
Author: Damian Guy <damian.guy@gmail.com>
Reviewers: Eno Thereska, Guozhang Wang
Closes #1840 from dguy/minor-fix
diff --git a/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java b/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java
index 63bb081..04d36f1 100644
--- a/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java
@@ -247,7 +247,11 @@
} catch (final IllegalStateException e) {
// Kafka Streams instance may have closed but rebalance hasn't happened
return false;
+ } catch (final InvalidStateStoreException e) {
+ // rebalance
+ return false;
}
+
return store != null && store.get(key) != null;
}
}, 30000, "waiting for metadata, store and value to be non null");
@@ -274,6 +278,9 @@
} catch (final IllegalStateException e) {
// Kafka Streams instance may have closed but rebalance hasn't happened
return false;
+ } catch (InvalidStateStoreException e) {
+ // rebalance
+ return false;
}
return store != null && store.fetch(key, from, to) != null;
}