summaryrefslogtreecommitdiff
path: root/lib/os_mon
diff options
context:
space:
mode:
authorLukas Larsson <lukas@erlang.org>2022-09-21 12:49:21 +0200
committerLukas Larsson <lukas@erlang.org>2022-09-21 12:49:21 +0200
commit1c28043ce0352e82394be045f0653714d963dbd9 (patch)
treef63aa3f0e94cdca20f3fb9e6119bcd0c70c61aff /lib/os_mon
parentdf31dfdaeff91f399e5b7e378a2cb10ba191d9d4 (diff)
downloaderlang-1c28043ce0352e82394be045f0653714d963dbd9.tar.gz
os_mon: Fix disksup full threshold testcase
On systems with 0% of used disk space this testcase used to fail. Note that 0% does not mean that 9 bytes was used, just that the df command rounded down to 0% usage.
Diffstat (limited to 'lib/os_mon')
-rw-r--r--lib/os_mon/test/disksup_SUITE.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl
index 1775456514..a583c1e4d7 100644
--- a/lib/os_mon/test/disksup_SUITE.erl
+++ b/lib/os_mon/test/disksup_SUITE.erl
@@ -332,8 +332,8 @@ otp_5910(Config) when is_list(Config) ->
0 ->
[{_Id,_Kbyte,Cap}|_] = Data,
io:format("Data ~p Threshold ~p ~n",[Data, Cap-1]),
- ok = disksup:set_almost_full_threshold((Cap-1)/100),
- Cap-1;
+ ok = disksup:set_almost_full_threshold((max(0, Cap-1))/100),
+ max(0, Cap-1);
_N -> Threshold0
end,
ok = application:set_env(os_mon, disk_almost_full_threshold, Threshold/100),