aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-06-20 08:19:54 +0200
committerJohn Högberg <[email protected]>2018-06-21 11:45:26 +0200
commitd3147dd8fc0ee913bc7146efb4d041d04f6582d8 (patch)
treee0186d2df636abbb85b68d3315b8e1a3cd571e63
parentc976e4bcfe1568f8bf836cd14307bd6e32bee37c (diff)
downloadotp-d3147dd8fc0ee913bc7146efb4d041d04f6582d8.tar.gz
otp-d3147dd8fc0ee913bc7146efb4d041d04f6582d8.tar.bz2
otp-d3147dd8fc0ee913bc7146efb4d041d04f6582d8.zip
Account for the number of workers in system_info_SUITE:memory
This reduces instability on test rigs with more than a handful schedulers.
-rw-r--r--erts/emulator/test/system_info_SUITE.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/erts/emulator/test/system_info_SUITE.erl b/erts/emulator/test/system_info_SUITE.erl
index 21ab6b378a..8ea2d88ec4 100644
--- a/erts/emulator/test/system_info_SUITE.erl
+++ b/erts/emulator/test/system_info_SUITE.erl
@@ -457,11 +457,16 @@ cmp_memory(MWs, Str) ->
%% Total, processes, processes_used, and system will seldom
%% give us exactly the same result since the two readings
%% aren't taken atomically.
+ %%
+ %% Torerance is scaled according to the number of schedulers
+ %% to match spawn_mem_workers.
+
+ Tolerance = 1.05 + 0.01 * erlang:system_info(schedulers_online),
- cmp_memory(total, EM, EDM, 1.05),
- cmp_memory(processes, EM, EDM, 1.05),
- cmp_memory(processes_used, EM, EDM, 1.05),
- cmp_memory(system, EM, EDM, 1.05),
+ cmp_memory(total, EM, EDM, Tolerance),
+ cmp_memory(processes, EM, EDM, Tolerance),
+ cmp_memory(processes_used, EM, EDM, Tolerance),
+ cmp_memory(system, EM, EDM, Tolerance),
ok.