File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import scyjava
1010
1111
12- def magnitude (x : int ) -> int :
13- return math .floor (math .log10 (abs (x )))
14-
15-
1612mb_initial = 50 # initial MB of memory to snarf up
13+ mb_tolerance = 10 # ceiling of expected MB in use
1714
1815scyjava .config .set_heap_min (mb = mb_initial )
1916scyjava .config .set_heap_max (gb = 1 )
@@ -35,9 +32,7 @@ def magnitude(x: int) -> int:
3532).is_less_than_or_equal_to (mb_max )
3633assert_that (mb_max , "maximum heap size should be approx. 1 GB" ).is_between (900 , 1024 )
3734
38- tolerance = pow (10 , magnitude (mb_initial ))
39-
40- assert_that (mb_used , "most memory should be available" ).is_less_than (tolerance )
35+ assert_that (mb_used , "most memory should be available" ).is_less_than (mb_tolerance )
4136assert_that (mb_total , "total memory should be close to initial" ).is_close_to (
42- mb_initial , tolerance = tolerance
37+ mb_initial , tolerance = mb_tolerance
4338)
You can’t perform that action at this time.
0 commit comments