diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-10 13:36:56 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-10 13:36:56 +0200 |
commit | c9da0893d3b49b99e29e95276437d792c6ac0c9a (patch) | |
tree | 1427d936c61ee1e94132c5e8948815f80f509ca9 /Lib/test/test_hashlib.py | |
parent | 9f8621fa7d3562f472b6a16854df51bfb3fdbd5f (diff) | |
download | cpython-git-c9da0893d3b49b99e29e95276437d792c6ac0c9a.tar.gz |
Issue #19886: Use better estimated memory requirements for bigmem tests.
Incorrect requirements can cause memory swapping.
Diffstat (limited to 'Lib/test/test_hashlib.py')
-rw-r--r-- | Lib/test/test_hashlib.py | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index e6365c5c5f..dac945c97a 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -207,30 +207,20 @@ class HashLibTestCase(unittest.TestCase): self.check('md5', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'd174ab98d277d9f5a5611c2c9f419d9f') - @precisionbigmemtest(size=_4G + 5, memuse=1) + @unittest.skipIf(sys.maxsize < _4G + 5, 'test cannot run on 32-bit systems') + @precisionbigmemtest(size=_4G + 5, memuse=1, dry_run=False) def test_case_md5_huge(self, size): - if size == _4G + 5: - try: - self.check('md5', 'A'*size, 'c9af2dff37468ce5dfee8f2cfc0a9c6d') - except OverflowError: - pass # 32-bit arch + self.check('md5', 'A'*size, 'c9af2dff37468ce5dfee8f2cfc0a9c6d') - @precisionbigmemtest(size=_4G + 5, memuse=1) + @unittest.skipIf(sys.maxsize < _4G + 5, 'test cannot run on 32-bit systems') + @precisionbigmemtest(size=_4G + 5, memuse=1, dry_run=False) def test_case_md5_huge_update(self, size): - if size == _4G + 5: - try: - self.check_update('md5', 'A'*size, - 'c9af2dff37468ce5dfee8f2cfc0a9c6d') - except OverflowError: - pass # 32-bit arch + self.check_update('md5', 'A'*size, 'c9af2dff37468ce5dfee8f2cfc0a9c6d') - @precisionbigmemtest(size=_4G - 1, memuse=1) + @unittest.skipIf(sys.maxsize < _4G - 1, 'test cannot run on 32-bit systems') + @precisionbigmemtest(size=_4G - 1, memuse=1, dry_run=False) def test_case_md5_uintmax(self, size): - if size == _4G - 1: - try: - self.check('md5', 'A'*size, '28138d306ff1b8281f1a9067e1a1a2b3') - except OverflowError: - pass # 32-bit arch + self.check('md5', 'A'*size, '28138d306ff1b8281f1a9067e1a1a2b3') # use the three examples from Federal Information Processing Standards # Publication 180-1, Secure Hash Standard, 1995 April 17 |