Skip to content

Commit 732ce10

Browse files
vzasadeAliaksey Artamonau
authored andcommitted
MB-27849 test to check that total of calculated default quotas should not
...exceed allowed memory Change-Id: I5af4c7916cc3aaa507d692c0a1c3c98c46d89acf Reviewed-on: http://review.couchbase.org/88725 Tested-by: Artem Stemkovski <[email protected]> Reviewed-by: Aliaksey Artamonau <[email protected]>
1 parent fbfe49b commit 732ce10

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/memory_quota.erl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
-include("ns_common.hrl").
2121
-include("ns_config.hrl").
2222

23+
-include_lib("eunit/include/eunit.hrl").
24+
2325
-export([this_node_memory_data/0,
2426
get_total_buckets_ram_quota/1,
2527
check_quotas/3,
@@ -313,3 +315,11 @@ default_quotas(Services, MemSupData) ->
313315
MinQuotasServices),
314316

315317
Result.
318+
319+
default_quotas_test() ->
320+
MemSupData = {9822564352, undefined, undefined},
321+
Services = services_ranking(),
322+
Quotas = default_quotas(Services, MemSupData),
323+
TotalQuota = lists:sum([Q || {_, Q} <- Quotas]),
324+
325+
?assertEqual(true, allowed_memory_usage_max(MemSupData) >= TotalQuota).

0 commit comments

Comments
 (0)