kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject [kafka] branch trunk updated: MINOR: Fix flaky test shouldQueryOnlyActivePartitionStoresByDefault (#9681)
Date Thu, 03 Dec 2020 22:00:38 GMT
This is an automated email from the ASF dual-hosted git repository.

guozhang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 7c68531  MINOR: Fix flaky test shouldQueryOnlyActivePartitionStoresByDefault (#9681)
7c68531 is described below

commit 7c68531a1f114e39f04532ed1c59619c25a143f3
Author: Bruno Cadonna <bruno@confluent.io>
AuthorDate: Thu Dec 3 22:59:32 2020 +0100

    MINOR: Fix flaky test shouldQueryOnlyActivePartitionStoresByDefault (#9681)
    
    Reviewers: Guozhang Wang <wangguoz@gmail.com>
---
 .../apache/kafka/streams/integration/StoreQueryIntegrationTest.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/streams/src/test/java/org/apache/kafka/streams/integration/StoreQueryIntegrationTest.java
b/streams/src/test/java/org/apache/kafka/streams/integration/StoreQueryIntegrationTest.java
index 712ae91..9142314 100644
--- a/streams/src/test/java/org/apache/kafka/streams/integration/StoreQueryIntegrationTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/integration/StoreQueryIntegrationTest.java
@@ -136,13 +136,13 @@ public class StoreQueryIntegrationTest {
 
             final boolean kafkaStreams1IsActive = (keyQueryMetadata.activeHost().port() %
2) == 1;
 
-            // Assert that only active is able to query for a key by default
-            assertThat(kafkaStreams1IsActive ? store1.get(key) : store2.get(key), is(notNullValue()));
             try {
                 if (kafkaStreams1IsActive) {
+                    assertThat(store1.get(key), is(notNullValue()));
                     assertThat(store2.get(key), is(nullValue()));
                 } else {
                     assertThat(store1.get(key), is(nullValue()));
+                    assertThat(store2.get(key), is(notNullValue()));
                 }
                 return true;
             } catch (final InvalidStateStoreException exception) {


Mime
View raw message