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 38CF02009F8 for ; Fri, 3 Jun 2016 15:14:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 37A3C160A2A; Fri, 3 Jun 2016 13:14:59 +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 81AC0160A25 for ; Fri, 3 Jun 2016 15:14:58 +0200 (CEST) Received: (qmail 22643 invoked by uid 500); 3 Jun 2016 13:14:57 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 22632 invoked by uid 99); 3 Jun 2016 13:14:57 -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, 03 Jun 2016 13:14:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5F594DFC13; Fri, 3 Jun 2016 13:14:57 +0000 (UTC) From: mjwall To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request #107: ACCUMULO-4157 Bug fix for removing WALs to quick... Content-Type: text/plain Message-Id: <20160603131457.5F594DFC13@git1-us-west.apache.org> Date: Fri, 3 Jun 2016 13:14:57 +0000 (UTC) archived-at: Fri, 03 Jun 2016 13:14:59 -0000 Github user mjwall commented on a diff in the pull request: https://github.com/apache/accumulo/pull/107#discussion_r65704590 --- Diff: server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java --- @@ -234,4 +257,288 @@ public void testIsUUID() { assertFalse(GarbageCollectWriteAheadLogs.isUUID("0" + UUID.randomUUID().toString())); assertFalse(GarbageCollectWriteAheadLogs.isUUID(null)); } + + @Test + public void testTimeToDeleteTrue() throws InterruptedException { + gcwal.clearFirstSeenDead(); + HostAndPort address = HostAndPort.fromString("tserver1:9998"); + long wait = AccumuloConfiguration.getTimeInMillis("1s"); + gcwal.timeToDelete(address, wait); // to store first seen dead + sleep(wait * 2); + assertTrue(gcwal.timeToDelete(address, wait)); + } + + @Test + public void testTimeToDeleteFalse() { + HostAndPort address = HostAndPort.fromString("tserver1:9998"); + long wait = AccumuloConfiguration.getTimeInMillis("1h"); + long t1, t2; + boolean ttd; + do { + t1 = System.nanoTime(); + gcwal.clearFirstSeenDead(); + gcwal.timeToDelete(address, wait); + ttd = gcwal.timeToDelete(address, wait); + t2 = System.nanoTime(); + } while (t2 - t1 > (wait / 2) * 1000000); // as long as it took less than half of the configured wait --- End diff -- yep, will change --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---