You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2021/01/15 17:35:27 UTC

[kafka] branch 2.7 updated: MINOR: Fix flaky test shouldQueryOnlyActivePartitionStoresByDefault (#9681)

This is an automated email from the ASF dual-hosted git repository.

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


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

commit 9cebfcb926c389c61cfb415c5eab6fcd102ea0c1
Author: Bruno Cadonna <br...@confluent.io>
AuthorDate: Thu Dec 3 22:59:32 2020 +0100

    MINOR: Fix flaky test shouldQueryOnlyActivePartitionStoresByDefault (#9681)
    
    Reviewers: Guozhang Wang <wa...@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) {