Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F191F200CBE for ; Fri, 7 Jul 2017 14:29:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F0178168F4E; Fri, 7 Jul 2017 12:29:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 424D9168F41 for ; Fri, 7 Jul 2017 14:29:13 +0200 (CEST) Received: (qmail 98179 invoked by uid 500); 7 Jul 2017 12:29:12 -0000 Mailing-List: contact commits-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list commits@kafka.apache.org Received: (qmail 98168 invoked by uid 99); 7 Jul 2017 12:29:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jul 2017 12:29:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4CAD9DFF8A; Fri, 7 Jul 2017 12:29:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: damianguy@apache.org To: commits@kafka.apache.org Message-Id: <074aba2aadcc45099b0fd609f4a91a64@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: kafka git commit: KAFKA-5566; fix unit test shouldAllowToQueryAfterThreadDied Date: Fri, 7 Jul 2017 12:29:12 +0000 (UTC) archived-at: Fri, 07 Jul 2017 12:29:14 -0000 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 Reviewers: Damian Guy 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 Authored: Fri Jul 7 13:29:05 2017 +0100 Committer: Damian Guy 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() { @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; }