From dev-return-67640-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Fri Feb 16 23:39:41 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0963E180647 for ; Fri, 16 Feb 2018 23:39:40 +0100 (CET) Received: (qmail 21294 invoked by uid 500); 16 Feb 2018 22:39:39 -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 21278 invoked by uid 99); 16 Feb 2018 22:39:39 -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, 16 Feb 2018 22:39:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BA65DFBBB; Fri, 16 Feb 2018 22:39:37 +0000 (UTC) From: mfenes To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #458: ZOOKEEPER-2967: Add check to validate dataDir a... Content-Type: text/plain Message-Id: <20180216223938.1BA65DFBBB@git1-us-west.apache.org> Date: Fri, 16 Feb 2018 22:39:37 +0000 (UTC) Github user mfenes commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/458#discussion_r168888396 --- Diff: src/java/test/org/apache/zookeeper/test/ClientBase.java --- @@ -368,22 +368,37 @@ static void verifyThreadTerminated(Thread thread, long millis) } } + public static File createEmptyTestDir() throws IOException { + return createTmpDir(BASETEST, false); + } public static File createTmpDir() throws IOException { - return createTmpDir(BASETEST); + return createTmpDir(BASETEST, true); } - static File createTmpDir(File parentDir) throws IOException { + static File createTmpDir(File parentDir, boolean createInitFile) throws IOException { File tmpFile = File.createTempFile("test", ".junit", parentDir); // don't delete tmpFile - this ensures we don't attempt to create // a tmpDir with a duplicate name File tmpDir = new File(tmpFile + ".dir"); Assert.assertFalse(tmpDir.exists()); // never true if tmpfile does it's job Assert.assertTrue(tmpDir.mkdirs()); + // todo not every tmp directory needs this file --- End diff -- Unfortunately this todo comment is in the master branch from where I backported these changes in ClientBase. ---