kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From damian...@apache.org
Subject kafka git commit: KAFKA-5566; fix unit test shouldAllowToQueryAfterThreadDied
Date Fri, 07 Jul 2017 12:29:12 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 6ea36bc6f -> 071b8f975


KAFKA-5566; fix unit test shouldAllowToQueryAfterThreadDied

Ensure only one thread dies, not both.

Author: Eno Thereska <eno.thereska@gmail.com>

Reviewers: Damian Guy <damian.guy@gmail.com>

Closes #3500 from enothereska/hotfix-queryable-state


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/071b8f97
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/071b8f97
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/071b8f97

Branch: refs/heads/trunk
Commit: 071b8f975f3f4eeb5659ffe04dbffafa0c8ab263
Parents: 6ea36bc
Author: Eno Thereska <eno.thereska@gmail.com>
Authored: Fri Jul 7 13:29:05 2017 +0100
Committer: Damian Guy <damian.guy@gmail.com>
Committed: Fri Jul 7 13:29:05 2017 +0100

----------------------------------------------------------------------
 .../streams/integration/QueryableStateIntegrationTest.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/071b8f97/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java
----------------------------------------------------------------------
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 d5cea24..1a39a4a 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
@@ -728,9 +728,10 @@ public class QueryableStateIntegrationTest {
             .reduce(new Reducer<String>() {
                 @Override
                 public String apply(final String value1, final String value2) {
-                    if (beforeFailure.get() && value1.length() > 1) {
-                        beforeFailure.set(false);
-                        throw new RuntimeException("Injected test exception");
+                    if (value1.length() > 1) {
+                        if (beforeFailure.compareAndSet(true, false)) {
+                            throw new RuntimeException("Injected test exception");
+                        }
                     }
                     return value1 + value2;
                 }


Mime
View raw message