diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-10 11:39:27 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-10 11:39:27 (GMT) |
commit | 786ac7b27d6eb36a53a91c41877f5cf86aa4f55f (patch) | |
tree | 5d5aee1b89f2d9809be9ab43364f1438bc1ce9cf /Lib/test/pickletester.py | |
parent | c1cb227b3fafd5cb112288e7c24466dff12d9a93 (diff) | |
parent | 4847e4e1f47bae9ed1855801c70ce7fbdecfa32a (diff) | |
download | cpython-786ac7b27d6eb36a53a91c41877f5cf86aa4f55f.zip cpython-786ac7b27d6eb36a53a91c41877f5cf86aa4f55f.tar.gz cpython-786ac7b27d6eb36a53a91c41877f5cf86aa4f55f.tar.bz2 |
Issue #19886: Use better estimated memory requirements for bigmem tests.
Incorrect requirements can cause memory swapping.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r-- | Lib/test/pickletester.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 1f59ab2..a2bea60 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -21,8 +21,6 @@ from pickle import bytes_types # kind of outer loop. protocols = range(pickle.HIGHEST_PROTOCOL + 1) -ascii_char_size = 1 - # Return True if opcode code appears in the pickle, else False. def opcode_in_pickle(code, pickle): @@ -1643,7 +1641,7 @@ class BigmemPickleTests(unittest.TestCase): # Binary protocols can serialize longs of up to 2GB-1 - @bigmemtest(size=_2G, memuse=1 + 1, dry_run=False) + @bigmemtest(size=_2G, memuse=3.6, dry_run=False) def test_huge_long_32b(self, size): data = 1 << (8 * size) try: @@ -1660,7 +1658,7 @@ class BigmemPickleTests(unittest.TestCase): # (older protocols don't have a dedicated opcode for bytes and are # too inefficient) - @bigmemtest(size=_2G, memuse=1 + 1, dry_run=False) + @bigmemtest(size=_2G, memuse=2.5, dry_run=False) def test_huge_bytes_32b(self, size): data = b"abcd" * (size // 4) try: @@ -1681,7 +1679,7 @@ class BigmemPickleTests(unittest.TestCase): finally: data = None - @bigmemtest(size=_4G, memuse=1 + 1, dry_run=False) + @bigmemtest(size=_4G, memuse=2.5, dry_run=False) def test_huge_bytes_64b(self, size): data = b"acbd" * (size // 4) try: @@ -1711,7 +1709,7 @@ class BigmemPickleTests(unittest.TestCase): # All protocols use 1-byte per printable ASCII character; we add another # byte because the encoded form has to be copied into the internal buffer. - @bigmemtest(size=_2G, memuse=2 + ascii_char_size, dry_run=False) + @bigmemtest(size=_2G, memuse=8, dry_run=False) def test_huge_str_32b(self, size): data = "abcd" * (size // 4) try: @@ -1738,7 +1736,7 @@ class BigmemPickleTests(unittest.TestCase): # of utf-8 encoded unicode. BINUNICODE8 (protocol 4) supports these huge # unicode strings however. - @bigmemtest(size=_4G, memuse=2 + ascii_char_size, dry_run=False) + @bigmemtest(size=_4G, memuse=8, dry_run=False) def test_huge_str_64b(self, size): data = "abcd" * (size // 4) try: |