@@ -1521,15 +1521,26 @@ set_disk_free_limit_command1(_Config) ->
15211521 ok = control_action (set_disk_free_limit ,
15221522 [" 2000kiB" ]),
15231523 2048000 = rabbit_disk_monitor :get_disk_free_limit (),
1524+
1525+ % % Use an integer
15241526 ok = control_action (set_disk_free_limit ,
1525- [" mem_relative" , " 1.1" ]),
1526- ExpectedLimit = 1.1 * vm_memory_monitor :get_total_memory (),
1527- % Total memory is unstable, so checking order
1528- true = ExpectedLimit / rabbit_disk_monitor :get_disk_free_limit () < 1.2 ,
1529- true = ExpectedLimit / rabbit_disk_monitor :get_disk_free_limit () > 0.98 ,
1527+ [" mem_relative" , " 1" ]),
1528+ check_limit (1 ),
1529+
1530+ % % Use a float
1531+ ok = control_action (set_disk_free_limit ,
1532+ [" mem_relative" , " 1.5" ]),
1533+ check_limit (1.5 ),
1534+
15301535 ok = control_action (set_disk_free_limit , [" 50MB" ]),
15311536 passed .
15321537
1538+ check_limit (Limit ) ->
1539+ ExpectedLimit = Limit * vm_memory_monitor :get_total_memory (),
1540+ % Total memory is unstable, so checking order
1541+ true = ExpectedLimit / rabbit_disk_monitor :get_disk_free_limit () < 1.2 ,
1542+ true = ExpectedLimit / rabbit_disk_monitor :get_disk_free_limit () > 0.98 .
1543+
15331544% % ---------------------------------------------------------------------------
15341545% % rabbitmqctl helpers.
15351546% % ---------------------------------------------------------------------------
0 commit comments