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:31:41 GMT
Repository: bookkeeper
Updated Branches:
  refs/heads/master 4a4802ab5 -> 7177f2a03


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/7177f2a0
Tree: http://git-wip-us.apache.org/repos/asf/bookkeeper/tree/7177f2a0
Diff: http://git-wip-us.apache.org/repos/asf/bookkeeper/diff/7177f2a0

Branch: refs/heads/master
Commit: 7177f2a03c52ca0457ea7d1a9c946f194ffb1c5f
Parents: 4a4802a
Author: Sijie Guo <sijie@apache.org>
Authored: Tue Mar 17 23:31:32 2015 -0700
Committer: Sijie Guo <sijie@apache.org>
Committed: Tue Mar 17 23:31:32 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/7177f2a0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index bbbe756..07e5419 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -63,6 +63,8 @@ Trunk (unreleased changes)
 
       BOOKKEEPER-828: Script for updating docs on website from master branch (ivank via sijie)
 
+      BOOKKEEPER-834: test case error in test class TestDiskChecker (zhaijia via sijie)
+
       bookkeeper-client:
 
         BOOKKEEPER-810: Allow to configure TCP connect timeout (Charles Xie via sijie)

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/7177f2a0/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