bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject bookkeeper git commit: BOOKKEEPER-834: test case error in test class TestDiskChecker (zhaijia via sijie)
Date Wed, 18 Mar 2015 06:36:27 GMT
Repository: bookkeeper
Updated Branches:
  refs/heads/branch-4.3 0802d1503 -> 9cbbd659c


BOOKKEEPER-834: test case error in test class TestDiskChecker (zhaijia via sijie)


Project: http://git-wip-us.apache.org/repos/asf/bookkeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/bookkeeper/commit/9cbbd659
Tree: http://git-wip-us.apache.org/repos/asf/bookkeeper/tree/9cbbd659
Diff: http://git-wip-us.apache.org/repos/asf/bookkeeper/diff/9cbbd659

Branch: refs/heads/branch-4.3
Commit: 9cbbd659c56b2f357efa7ffbe175a9cf97e5cb43
Parents: 0802d15
Author: Sijie Guo <sijie@apache.org>
Authored: Tue Mar 17 23:36:18 2015 -0700
Committer: Sijie Guo <sijie@apache.org>
Committed: Tue Mar 17 23:36:18 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                               |  2 ++
 .../java/org/apache/bookkeeper/util/TestDiskChecker.java  | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9cbbd659/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d0414a4..d3b1e88 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -24,6 +24,8 @@ Release 4.3.1 - unreleased
 
       BOOKKEEPER-840: Deadlock on flushLock on compaction (sijie)
 
+      BOOKKEEPER-834: test case error in test class TestDiskChecker (zhaijia via sijie)
+
     IMPROVEMENTS:
 
       BOOKKEEPER-800: Expose whether a ledger is closed or not (ivank)

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/9cbbd659/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestDiskChecker.java
----------------------------------------------------------------------
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestDiskChecker.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestDiskChecker.java
index ac1cb9f..8c899a5 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestDiskChecker.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestDiskChecker.java
@@ -70,7 +70,7 @@ public class TestDiskChecker {
         long usableSpace = file.getUsableSpace();
         long totalSpace = file.getTotalSpace();
         float threshold =
-                (1f - ((float) usableSpace / (float) totalSpace)) - 0.05f;
+                (1f - ((float) usableSpace / (float) totalSpace)) * 0.5f;
         diskChecker.setDiskSpaceThreshold(threshold, threshold);
         diskChecker.checkDiskFull(file);
     }
@@ -80,10 +80,10 @@ public class TestDiskChecker {
         File file = createTempDir("DiskCheck", "test");
         long usableSpace = file.getUsableSpace();
         long totalSpace = file.getTotalSpace();
-        float diskSpaceThreshold =
-                (1f - ((float) usableSpace / (float) totalSpace)) + 0.01f;
+        float diskSpaceThreshold = 
+                (1f - ((float) usableSpace / (float) totalSpace));
         float diskWarnThreshold =
-                (1f - ((float) usableSpace / (float) totalSpace)) - 0.05f;
+                (1f - ((float) usableSpace / (float) totalSpace)) * 0.5f;
         diskChecker.setDiskSpaceThreshold(diskSpaceThreshold, diskWarnThreshold);
         diskChecker.checkDiskFull(file);
     }
@@ -97,7 +97,7 @@ public class TestDiskChecker {
         File file = createTempDir("DiskCheck", "test");
         long usableSpace = file.getUsableSpace();
         long totalSpace = file.getTotalSpace();
-        float threshold = (1f - ((float) usableSpace / (float) totalSpace)) - 0.05f;
+        float threshold = (1f - ((float) usableSpace / (float) totalSpace)) * 0.5f;
         diskChecker.setDiskSpaceThreshold(threshold, threshold);
         assertTrue(file.delete());
         diskChecker.checkDiskFull(file);


Mime
View raw message