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 AE581200C76 for ; Fri, 28 Apr 2017 15:53:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AD193160BA3; Fri, 28 Apr 2017 13:53:41 +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 DD382160BBD for ; Fri, 28 Apr 2017 15:53:40 +0200 (CEST) Received: (qmail 15911 invoked by uid 500); 28 Apr 2017 13:53:40 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 15853 invoked by uid 99); 28 Apr 2017 13:53:40 -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, 28 Apr 2017 13:53:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E95A8E2F58; Fri, 28 Apr 2017 13:53:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: geomacy@apache.org To: commits@brooklyn.apache.org Date: Fri, 28 Apr 2017 13:53:43 -0000 Message-Id: <05efccf64d4e45769c070be4d5c3c6d2@git.apache.org> In-Reply-To: <1af0b6673b2543858644076742943035@git.apache.org> References: <1af0b6673b2543858644076742943035@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/10] brooklyn-server git commit: backoff more slowly when checking assertions, cause tests to run a bit quicker archived-at: Fri, 28 Apr 2017 13:53:41 -0000 backoff more slowly when checking assertions, cause tests to run a bit quicker Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/bd461adb Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/bd461adb Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/bd461adb Branch: refs/heads/master Commit: bd461adb4e0ebf882cbbedd55f4c6a7b6b54ebca Parents: bf69b0c Author: Alex Heneveld Authored: Tue Apr 25 16:08:13 2017 +0100 Committer: Alex Heneveld Committed: Fri Apr 28 14:09:51 2017 +0100 ---------------------------------------------------------------------- .../common/src/main/java/org/apache/brooklyn/test/Asserts.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/bd461adb/utils/common/src/main/java/org/apache/brooklyn/test/Asserts.java ---------------------------------------------------------------------- diff --git a/utils/common/src/main/java/org/apache/brooklyn/test/Asserts.java b/utils/common/src/main/java/org/apache/brooklyn/test/Asserts.java index 443d42b..b5cdcbc 100644 --- a/utils/common/src/main/java/org/apache/brooklyn/test/Asserts.java +++ b/utils/common/src/main/java/org/apache/brooklyn/test/Asserts.java @@ -993,7 +993,10 @@ public class Asserts { } long sleepTime = Math.min(sleepTimeBetweenAttempts, expireTime-System.currentTimeMillis()); if (sleepTime > 0) Thread.sleep(sleepTime); - sleepTimeBetweenAttempts = Math.min(sleepTimeBetweenAttempts*2, maxPeriod.toMilliseconds()); + sleepTimeBetweenAttempts = Math.min( + // grow by 1.5x; doubling causes longer extra waits than we like in tests + sleepTimeBetweenAttempts + Math.max(1, sleepTimeBetweenAttempts/2), + maxPeriod.toMilliseconds()); } log.info("succeedsEventually exceeded max attempts or timeout - {} attempts lasting {} ms, for {}", new Object[] {attempt, System.currentTimeMillis()-startTime, c});