diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py index 8bd210abe..2dca8abf0 100644 --- a/tests/cloudpickle_test.py +++ b/tests/cloudpickle_test.py @@ -1533,7 +1533,16 @@ def process_data(): # grown by more than a few MB as closures are garbage collected at # the end of each remote function call. growth = w.memsize() - reference_size - assert growth < 1e7, growth + + # For some reason, the memory growth after processing 100MB of + # data is ~10MB on MacOS, and ~1MB on Linux, so the upper bound on + # memory growth we use is only tight for MacOS. However, + # - 10MB is still 10x lower than the expected memory growth in case + # of a leak (which would be the total size of the processed data, + # 100MB) + # - the memory usage growth does not increase if using 10000 + # iterations instead of 100 as used now (100x more data) + assert growth < 1.5e7, growth """.format(protocol=self.protocol) assert_run_python_script(code)