Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2a14fde0
Commit
2a14fde0
authored
Jan 10, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #19886: Use better estimated memory requirements for bigmem tests.
Incorrect requirements can cause memory swapping.
parents
cb4af8f3
13718447
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
35 deletions
+27
-35
Lib/test/pickletester.py
Lib/test/pickletester.py
+5
-7
Lib/test/test_bz2.py
Lib/test/test_bz2.py
+1
-1
Lib/test/test_hashlib.py
Lib/test/test_hashlib.py
+10
-19
Lib/test/test_marshal.py
Lib/test/test_marshal.py
+5
-5
Lib/test/test_xml_etree_c.py
Lib/test/test_xml_etree_c.py
+1
-3
Misc/NEWS
Misc/NEWS
+5
-0
No files found.
Lib/test/pickletester.py
View file @
2a14fde0
...
@@ -21,8 +21,6 @@ from pickle import bytes_types
...
@@ -21,8 +21,6 @@ from pickle import bytes_types
# kind of outer loop.
# kind of outer loop.
protocols
=
range
(
pickle
.
HIGHEST_PROTOCOL
+
1
)
protocols
=
range
(
pickle
.
HIGHEST_PROTOCOL
+
1
)
ascii_char_size
=
1
# Return True if opcode code appears in the pickle, else False.
# Return True if opcode code appears in the pickle, else False.
def
opcode_in_pickle
(
code
,
pickle
):
def
opcode_in_pickle
(
code
,
pickle
):
...
@@ -1643,7 +1641,7 @@ class BigmemPickleTests(unittest.TestCase):
...
@@ -1643,7 +1641,7 @@ class BigmemPickleTests(unittest.TestCase):
# Binary protocols can serialize longs of up to 2GB-1
# 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
):
def
test_huge_long_32b
(
self
,
size
):
data
=
1
<<
(
8
*
size
)
data
=
1
<<
(
8
*
size
)
try
:
try
:
...
@@ -1660,7 +1658,7 @@ class BigmemPickleTests(unittest.TestCase):
...
@@ -1660,7 +1658,7 @@ class BigmemPickleTests(unittest.TestCase):
# (older protocols don't have a dedicated opcode for bytes and are
# (older protocols don't have a dedicated opcode for bytes and are
# too inefficient)
# 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
):
def
test_huge_bytes_32b
(
self
,
size
):
data
=
b"abcd"
*
(
size
//
4
)
data
=
b"abcd"
*
(
size
//
4
)
try
:
try
:
...
@@ -1681,7 +1679,7 @@ class BigmemPickleTests(unittest.TestCase):
...
@@ -1681,7 +1679,7 @@ class BigmemPickleTests(unittest.TestCase):
finally
:
finally
:
data
=
None
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
):
def
test_huge_bytes_64b
(
self
,
size
):
data
=
b"acbd"
*
(
size
//
4
)
data
=
b"acbd"
*
(
size
//
4
)
try
:
try
:
...
@@ -1711,7 +1709,7 @@ class BigmemPickleTests(unittest.TestCase):
...
@@ -1711,7 +1709,7 @@ class BigmemPickleTests(unittest.TestCase):
# All protocols use 1-byte per printable ASCII character; we add another
# 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.
# 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
):
def
test_huge_str_32b
(
self
,
size
):
data
=
"abcd"
*
(
size
//
4
)
data
=
"abcd"
*
(
size
//
4
)
try
:
try
:
...
@@ -1738,7 +1736,7 @@ class BigmemPickleTests(unittest.TestCase):
...
@@ -1738,7 +1736,7 @@ class BigmemPickleTests(unittest.TestCase):
# of utf-8 encoded unicode. BINUNICODE8 (protocol 4) supports these huge
# of utf-8 encoded unicode. BINUNICODE8 (protocol 4) supports these huge
# unicode strings however.
# 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
):
def
test_huge_str_64b
(
self
,
size
):
data
=
"abcd"
*
(
size
//
4
)
data
=
"abcd"
*
(
size
//
4
)
try
:
try
:
...
...
Lib/test/test_bz2.py
View file @
2a14fde0
...
@@ -686,7 +686,7 @@ class BZ2DecompressorTest(BaseTest):
...
@@ -686,7 +686,7 @@ class BZ2DecompressorTest(BaseTest):
self
.
assertRaises
(
EOFError
,
bz2d
.
decompress
,
b"anything"
)
self
.
assertRaises
(
EOFError
,
bz2d
.
decompress
,
b"anything"
)
self
.
assertRaises
(
EOFError
,
bz2d
.
decompress
,
b""
)
self
.
assertRaises
(
EOFError
,
bz2d
.
decompress
,
b""
)
@
bigmemtest
(
size
=
_4G
+
100
,
memuse
=
3
)
@
bigmemtest
(
size
=
_4G
+
100
,
memuse
=
3
.3
)
def
testDecompress4G
(
self
,
size
):
def
testDecompress4G
(
self
,
size
):
# "Test BZ2Decompressor.decompress() with >4GiB input"
# "Test BZ2Decompressor.decompress() with >4GiB input"
blocksize
=
10
*
1024
*
1024
blocksize
=
10
*
1024
*
1024
...
...
Lib/test/test_hashlib.py
View file @
2a14fde0
...
@@ -256,21 +256,15 @@ class HashLibTestCase(unittest.TestCase):
...
@@ -256,21 +256,15 @@ class HashLibTestCase(unittest.TestCase):
b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
,
b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
,
'd174ab98d277d9f5a5611c2c9f419d9f'
)
'd174ab98d277d9f5a5611c2c9f419d9f'
)
@
bigmemtest
(
size
=
_4G
+
5
,
memuse
=
1
)
@
unittest
.
skipIf
(
sys
.
maxsize
<
_4G
+
5
,
'test cannot run on 32-bit systems'
)
@
bigmemtest
(
size
=
_4G
+
5
,
memuse
=
1
,
dry_run
=
False
)
def
test_case_md5_huge
(
self
,
size
):
def
test_case_md5_huge
(
self
,
size
):
if
size
==
_4G
+
5
:
try
:
self
.
check
(
'md5'
,
b'A'
*
size
,
'c9af2dff37468ce5dfee8f2cfc0a9c6d'
)
self
.
check
(
'md5'
,
b'A'
*
size
,
'c9af2dff37468ce5dfee8f2cfc0a9c6d'
)
except
OverflowError
:
pass
# 32-bit arch
@
bigmemtest
(
size
=
_4G
-
1
,
memuse
=
1
)
@
unittest
.
skipIf
(
sys
.
maxsize
<
_4G
-
1
,
'test cannot run on 32-bit systems'
)
@
bigmemtest
(
size
=
_4G
-
1
,
memuse
=
1
,
dry_run
=
False
)
def
test_case_md5_uintmax
(
self
,
size
):
def
test_case_md5_uintmax
(
self
,
size
):
if
size
==
_4G
-
1
:
try
:
self
.
check
(
'md5'
,
b'A'
*
size
,
'28138d306ff1b8281f1a9067e1a1a2b3'
)
self
.
check
(
'md5'
,
b'A'
*
size
,
'28138d306ff1b8281f1a9067e1a1a2b3'
)
except
OverflowError
:
pass
# 32-bit arch
# use the three examples from Federal Information Processing Standards
# use the three examples from Federal Information Processing Standards
# Publication 180-1, Secure Hash Standard, 1995 April 17
# Publication 180-1, Secure Hash Standard, 1995 April 17
...
@@ -379,14 +373,11 @@ class HashLibTestCase(unittest.TestCase):
...
@@ -379,14 +373,11 @@ class HashLibTestCase(unittest.TestCase):
"e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"
+
"e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"
+
"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"
)
"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"
)
@
bigmemtest
(
size
=
_4G
+
5
,
memuse
=
1
)
@
unittest
.
skipIf
(
sys
.
maxsize
<
_4G
+
5
,
'test cannot run on 32-bit systems'
)
@
bigmemtest
(
size
=
_4G
+
5
,
memuse
=
1
,
dry_run
=
False
)
def
test_case_sha3_224_huge
(
self
,
size
):
def
test_case_sha3_224_huge
(
self
,
size
):
if
size
==
_4G
+
5
:
try
:
self
.
check
(
'sha3_224'
,
b'A'
*
size
,
self
.
check
(
'sha3_224'
,
b'A'
*
size
,
'58ef60057c9dddb6a87477e9ace5a26f0d9db01881cf9b10a9f8c224'
)
'58ef60057c9dddb6a87477e9ace5a26f0d9db01881cf9b10a9f8c224'
)
except
OverflowError
:
pass
# 32-bit arch
def
test_gil
(
self
):
def
test_gil
(
self
):
# Check things work fine with an input larger than the size required
# Check things work fine with an input larger than the size required
...
...
Lib/test/test_marshal.py
View file @
2a14fde0
...
@@ -288,19 +288,19 @@ class LargeValuesTestCase(unittest.TestCase):
...
@@ -288,19 +288,19 @@ class LargeValuesTestCase(unittest.TestCase):
def
check_unmarshallable
(
self
,
data
):
def
check_unmarshallable
(
self
,
data
):
self
.
assertRaises
(
ValueError
,
marshal
.
dump
,
data
,
NullWriter
())
self
.
assertRaises
(
ValueError
,
marshal
.
dump
,
data
,
NullWriter
())
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
1
,
dry_run
=
False
)
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
2
,
dry_run
=
False
)
def
test_bytes
(
self
,
size
):
def
test_bytes
(
self
,
size
):
self
.
check_unmarshallable
(
b'x'
*
size
)
self
.
check_unmarshallable
(
b'x'
*
size
)
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
1
,
dry_run
=
False
)
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
2
,
dry_run
=
False
)
def
test_str
(
self
,
size
):
def
test_str
(
self
,
size
):
self
.
check_unmarshallable
(
'x'
*
size
)
self
.
check_unmarshallable
(
'x'
*
size
)
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
pointer_size
,
dry_run
=
False
)
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
pointer_size
+
1
,
dry_run
=
False
)
def
test_tuple
(
self
,
size
):
def
test_tuple
(
self
,
size
):
self
.
check_unmarshallable
((
None
,)
*
size
)
self
.
check_unmarshallable
((
None
,)
*
size
)
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
pointer_size
,
dry_run
=
False
)
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
pointer_size
+
1
,
dry_run
=
False
)
def
test_list
(
self
,
size
):
def
test_list
(
self
,
size
):
self
.
check_unmarshallable
([
None
]
*
size
)
self
.
check_unmarshallable
([
None
]
*
size
)
...
@@ -316,7 +316,7 @@ class LargeValuesTestCase(unittest.TestCase):
...
@@ -316,7 +316,7 @@ class LargeValuesTestCase(unittest.TestCase):
def
test_frozenset
(
self
,
size
):
def
test_frozenset
(
self
,
size
):
self
.
check_unmarshallable
(
frozenset
(
range
(
size
)))
self
.
check_unmarshallable
(
frozenset
(
range
(
size
)))
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
1
,
dry_run
=
False
)
@
support
.
bigmemtest
(
size
=
LARGE_SIZE
,
memuse
=
2
,
dry_run
=
False
)
def
test_bytearray
(
self
,
size
):
def
test_bytearray
(
self
,
size
):
self
.
check_unmarshallable
(
bytearray
(
size
))
self
.
check_unmarshallable
(
bytearray
(
size
))
...
...
Lib/test/test_xml_etree_c.py
View file @
2a14fde0
...
@@ -13,10 +13,8 @@ cET_alias = import_fresh_module('xml.etree.cElementTree',
...
@@ -13,10 +13,8 @@ cET_alias = import_fresh_module('xml.etree.cElementTree',
class
MiscTests
(
unittest
.
TestCase
):
class
MiscTests
(
unittest
.
TestCase
):
# Issue #8651.
# Issue #8651.
@
support
.
bigmemtest
(
size
=
support
.
_2G
+
100
,
memuse
=
1
)
@
support
.
bigmemtest
(
size
=
support
.
_2G
+
100
,
memuse
=
1
,
dry_run
=
False
)
def
test_length_overflow
(
self
,
size
):
def
test_length_overflow
(
self
,
size
):
if
size
<
support
.
_2G
+
100
:
self
.
skipTest
(
"not enough free memory, need at least 2 GB"
)
data
=
b'x'
*
size
data
=
b'x'
*
size
parser
=
cET
.
XMLParser
()
parser
=
cET
.
XMLParser
()
try
:
try
:
...
...
Misc/NEWS
View file @
2a14fde0
...
@@ -58,6 +58,11 @@ IDLE
...
@@ -58,6 +58,11 @@ IDLE
- Issue #18960: IDLE now ignores the source encoding declaration on the second
- Issue #18960: IDLE now ignores the source encoding declaration on the second
line if the first line contains anything except a comment.
line if the first line contains anything except a comment.
Tests
-----
- Issue #19886: Use better estimated memory requirements for bigmem tests.
Tools/Demos
Tools/Demos
-----------
-----------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment