gh-108418: Speed up bigmem compression tests in dry mode (GH-108419)

Only generate and compress small amount of random data in dry run.
This commit is contained in:
Serhiy Storchaka 2023-08-25 12:37:27 +03:00 committed by GitHub
parent e59a95238b
commit 4ae3edf300
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -721,10 +721,10 @@ class BZ2DecompressorTest(BaseTest):
@bigmemtest(size=_4G + 100, memuse=3.3)
def testDecompress4G(self, size):
# "Test BZ2Decompressor.decompress() with >4GiB input"
blocksize = 10 * 1024 * 1024
blocksize = min(10 * 1024 * 1024, size)
block = random.randbytes(blocksize)
try:
data = block * (size // blocksize + 1)
data = block * ((size-1) // blocksize + 1)
compressed = bz2.compress(data)
bz2d = BZ2Decompressor()
decompressed = bz2d.decompress(compressed)