8000 TST: Don't fail check_large_zip on signal 9 · lithomas1/numpy@6c3cabd · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c3cabd

Browse files
committed
TST: Don't fail check_large_zip on signal 9
If the test is terminated for lack of memory the intended zip file check does not take place, raise xfail instead.
1 parent
10000
 40a1d54 commit 6c3cabd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

numpy/lib/tests/test_io.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def check_large_zip(memoryerror_raised):
580580
memoryerror_raised.value = False
581581
try:
582582
# The test takes at least 6GB of memory, writes a file larger
583-
# than 4GB
583+
# than 4GB. This tests the ``allowZip64`` kwarg to ``zipfile``
584584
test_data = np.asarray([np.random.rand(
585585
np.random.randint(50,100),4)
586586
for i in range(800000)], dtype=object)
@@ -599,6 +599,9 @@ def check_large_zip(memoryerror_raised):
599599
p.join()
600600
if memoryerror_raised.value:
601601
raise MemoryError("Child process raised a MemoryError exception")
602+
# -9 indicates a SIGKILL, probably an OOM.
603+
if p.exitcode == -9:
604+
pytest.xfail("subprocess got a SIGKILL, apparently free memory was not sufficient")
602605
assert p.exitcode == 0
603606

604607
class LoadTxtBase:

0 commit comments

Comments
 (0)
0