diff options
author | Sverker Eriksson <[email protected]> | 2018-07-11 22:11:19 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-07-11 22:11:19 +0200 |
commit | 7b206e455df25a8e4ae78cae1939748ed693be40 (patch) | |
tree | 4d1bff8b41da4a5ecc241a43f0e94ad6c8bbc545 /lib | |
parent | c7a831d68e84b05b03c693d29d1c127edc0170f7 (diff) | |
parent | 97626fffd082904576efbdad3e437720525d5fc2 (diff) | |
download | otp-7b206e455df25a8e4ae78cae1939748ed693be40.tar.gz otp-7b206e455df25a8e4ae78cae1939748ed693be40.tar.bz2 otp-7b206e455df25a8e4ae78cae1939748ed693be40.zip |
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/os_mon/test/cpu_sup_SUITE.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl index 7122d23503..ba28f31f26 100644 --- a/lib/os_mon/test/cpu_sup_SUITE.erl +++ b/lib/os_mon/test/cpu_sup_SUITE.erl @@ -122,19 +122,19 @@ util_api(Config) when is_list(Config) -> %% util([]) {all, Busy1, NonBusy1, []} = cpu_sup:util([]), - 100.00 = Busy1 + NonBusy1, + true = tiny_diff(100.00, Busy1 + NonBusy1), %% util([detailed]) {Cpus2, Busy2, NonBusy2, []} = cpu_sup:util([detailed]), true = lists:all(fun(X) -> is_integer(X) end, Cpus2), true = lists:all(BusyP, Busy2), true = lists:all(NonBusyP, NonBusy2), - 100.00 = lists:foldl(Sum,0,Busy2)+lists:foldl(Sum,0,NonBusy2), + true = tiny_diff(100.00, lists:foldl(Sum,0,Busy2)+lists:foldl(Sum,0,NonBusy2)), %% util([per_cpu]) [{Cpu3, Busy3, NonBusy3, []}|_] = cpu_sup:util([per_cpu]), true = is_integer(Cpu3), - 100.00 = Busy3 + NonBusy3, + true = tiny_diff(100.00, Busy3 + NonBusy3), %% util([detailed, per_cpu]) [{Cpu4, Busy4, NonBusy4, []}|_] = @@ -142,7 +142,7 @@ util_api(Config) when is_list(Config) -> true = is_integer(Cpu4), true = lists:all(BusyP, Busy2), true = lists:all(NonBusyP, NonBusy2), - 100.00 = lists:foldl(Sum,0,Busy4)+lists:foldl(Sum,0,NonBusy4), + true = tiny_diff(100.00, lists:foldl(Sum,0,Busy4)+lists:foldl(Sum,0,NonBusy4)), %% bad util/1 calls {'EXIT',{badarg,_}} = (catch cpu_sup:util(detailed)), @@ -150,6 +150,9 @@ util_api(Config) when is_list(Config) -> ok. +tiny_diff(A, B) -> + (abs(A - B) < 1.0e-11). + -define(SPIN_TIME, 1000). %% Test utilization values |