Skip to content

Commit fc1d70a

Browse files
authored
Make tests retain 4GB less RAM (#80)
* Save 4 more gigabytes when running tests by not holding on to huge string * Limit maximum heap size when running tests to ensure streaming doesn’t hold on to data
1 parent 6dbc77e commit fc1d70a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

zlib/test/Test.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,12 @@ test_exception = ioProperty $ do
289289

290290
test_compress_large_chunk :: Property
291291
test_compress_large_chunk =
292-
GZip.decompress (GZip.compress (BL.replicate len 0)) === BL.replicate len 0
292+
counterexample
293+
("Expected " ++ show len ++ " zeros but got different result, please investigate manually")
294+
(property test)
293295
where
296+
test = GZip.decompress (GZip.compress (BL.replicate len 0)) == BL.replicate len 0
297+
294298
len = case finiteBitSize (0 :: Int) of
295299
64 -> (1 `shiftL` 32) + 1
296300
_ -> 0 -- ignore it

zlib/zlib.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ test-suite tests
130130
tasty >= 0.8 && < 1.6,
131131
tasty-quickcheck >= 0.8 && < 1
132132
ghc-options: -Wall
133+
--with-rtsopts="-M1G"

0 commit comments

Comments
 (0)