From dev-return-82091-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Fri Jul 26 12:54:33 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7A686180595 for ; Fri, 26 Jul 2019 14:54:33 +0200 (CEST) Received: (qmail 24279 invoked by uid 500); 26 Jul 2019 12:54:32 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 24268 invoked by uid 99); 26 Jul 2019 12:54:32 -0000 Received: from Unknown (HELO mailrelay1-lw-us.apache.org) (10.10.3.159) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jul 2019 12:54:32 +0000 Received: from andors-macbook-pro.local (unknown [185.63.45.212]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 13B628104 for ; Fri, 26 Jul 2019 12:54:28 +0000 (UTC) From: Andor Molnar Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: New flaky: testLearnerMetricsTest Date: Fri, 26 Jul 2019 14:54:27 +0200 References: To: DevZooKeeper In-Reply-To: Message-Id: <54C9C6CD-BDA4-438B-8C4C-25B73CAF322A@apache.org> X-Mailer: Apple Mail (2.3445.104.11) Jira created. https://issues.apache.org/jira/browse/ZOOKEEPER-3470 Andor > On 2019. Jul 24., at 8:17, Enrico Olivelli = wrote: >=20 > Il mar 23 lug 2019, 22:30 Patrick Hunt ha scritto: >=20 >> Yea, thread sleep (without some sort of retry/timeout logic) is an >> antipattern. Committers - please be on the lookout for such things = and flag >> them during review as they are a significant cause of flakeys. In a = heavily >> loaded or virtualized environment even seconds can be insufficient. >>=20 >> QuorumTest line 320 or so is a better example. In many places we use >> countdownlatches instead... >>=20 >> I see someone attempted to add "waitFor" but it never caught on? = Might be >> better approach. >>=20 >=20 > It is really a better practice. >=20 > Enrico >=20 >=20 >> zookeeper-server/src/test/java/org/apache/zookeeper/ZKTestCase.java >> 95: public void waitFor(String msg, WaitForCondition condition, = int >> timeout) >>=20 >> Patrick >>=20 >> On Mon, Jul 22, 2019 at 1:47 AM Andor Molnar = wrote: >>=20 >>> Hi team, >>>=20 >>> New test testLearnerMetricsTest() added by the following commit = failed 2 >>> times on master with the same error: >>>=20 >>> junit.framework.AssertionFailedError: expected:<10> but was:<9> >>> at >>>=20 >> = org.apache.zookeeper.server.quorum.LearnerMetricsTest.testLearnerMetricsTe= st(LearnerMetricsTest.java:88) >>> at >>>=20 >> = org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4= ZKTestRunner.java:80) >>>=20 >>> https://github.com/apache/zookeeper/pull/856 >>> Submitted by: jhuan31 >>>=20 >>> Maybe we should just blame the Thread.sleep(200) in line:77 and = replace >> it >>> with some clever logic. >>> Please take a look. >>>=20 >>> Regards, >>> Andor >>>=20 >>>=20 >>>=20 >>=20