]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
zstreamtest : disabled multi-threading tests with --newapi --no-big-tests
authorYann Collet <cyan@fb.com>
Fri, 23 Jun 2017 07:09:02 +0000 (00:09 -0700)
committerYann Collet <cyan@fb.com>
Fri, 23 Jun 2017 07:09:02 +0000 (00:09 -0700)
--no-big-tests is typically used in combination with qemu-user-static
qemu-user-static allocated 4 GB of RAM upfront.
On 2 GB VM, this can degenerate into a crash.
It's not a problem as long as memory is not used.
But with multi-threading enabled, memory fragmentation kicks in,
so the amoung of RAM effectively touched increases,
and can pass beyond the 2 GB limit of the VM.

In single-threaded mode, there is no such issue :
memory requirement is smaller, and remains well-located,
so very little fragmentation is expected.

This modification should make `qemu-arm-static zstreamtests --newapi --no-big-tests`
work fine on Travis CI.

tests/zstreamtest.c

index 3ab8d05376873a7c93aa5e27a49b365ad562ed60..33ed11f937fa417e4f4afada732fabb8dd2599ac 100644 (file)
@@ -1193,7 +1193,7 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double
     size_t dictSize = 0;
     U32 oldTestLog = 0;
     U32 const cLevelMax = bigTests ? (U32)ZSTD_maxCLevel() : g_cLevelMax_smallTests;
-    U32 const nbThreadsMax = bigTests ? 5 : 2;
+    U32 const nbThreadsMax = bigTests ? 5 : 1;
 
     /* allocations */
     cNoiseBuffer[0] = (BYTE*)malloc (srcBufferSize);