From: Nick Terrell Date: Thu, 27 Sep 2018 22:49:31 +0000 (-0700) Subject: Reset number of threads less often X-Git-Tag: v1.3.6^2~13^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1343%2Fhead;p=thirdparty%2Fzstd.git Reset number of threads less often --- diff --git a/tests/zstreamtest.c b/tests/zstreamtest.c index b56009323..105e63e7d 100644 --- a/tests/zstreamtest.c +++ b/tests/zstreamtest.c @@ -1864,8 +1864,9 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, CHECK_Z( ZSTD_CCtx_setPledgedSrcSize(zc, pledgedSrcSize) ); } - /* multi-threading parameters */ - { U32 const nbThreadsCandidate = (FUZ_rand(&lseed) & 4) + 1; + /* multi-threading parameters. Only adjust ocassionally for small tests. */ + if (bigTests || (FUZ_rand(&lseed) & 0xF) == 0xF) { + U32 const nbThreadsCandidate = (FUZ_rand(&lseed) & 4) + 1; U32 const nbThreadsAdjusted = (windowLogMalus < nbThreadsCandidate) ? nbThreadsCandidate - windowLogMalus : 1; U32 const nbThreads = MIN(nbThreadsAdjusted, nbThreadsMax); DISPLAYLEVEL(5, "t%u: nbThreads : %u \n", testNb, nbThreads);