Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
Merge 1749aee into 0312739
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav-Smirnov committed Aug 12, 2019
2 parents 0312739 + 1749aee commit 4084742
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
4 changes: 2 additions & 2 deletions buildscripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
source activate $CONDA_ENV

# generate test data for test_io
python hpat/tests/gen_test_data.py
python -m hpat.tests.gen_test_data

if [ "$RUN_COVERAGE" == "yes" ]; then
export PYTHONPATH=.
coverage erase
coverage run --source=./hpat --omit ./hpat/ml/*,./hpat/xenon_ext.py,./hpat/ros.py,./hpat/cv_ext.py,./hpat/tests/* -m unittest
else
mpiexec -n $NUM_PES python -u -m unittest -v
mpiexec -n $NUM_PES python -u -m hpat.runtests -v
fi
30 changes: 29 additions & 1 deletion hpat/runtests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
import os
import unittest
import hpat.tests

"""
Every test in suite can be executed specified times using
value > 2 for REPEAT_TEST_NUMBER environment variable.
This can be used to locate scpecific failures occured
on next execution of affected test.
loadTestsFromModule returns TestSuite obj with _tests member
which contains further TestSuite instanses for each found testCase:
hpat_tests = TestSuite(hpat.tests)
TestSuite(hpat.tests)._tests = [TestSuite(hpat.tests.TestBasic), TestSuite(hpat.tests.TestDataFrame), ...]
TestSuite(hpat.tests.TestBasic)._tests = [TestBasic testMethod=test_array_reduce, ...]
"""
def load_tests(loader, tests, pattern):
suite = unittest.TestSuite()
suite.addTests(loader.loadTestsFromModule(hpat.tests))
hpat_tests = loader.loadTestsFromModule(hpat.tests)

repeat_test_number = 1
if 'REPEAT_TEST_NUMBER' in os.environ:
repeat_test_number = os.environ['REPEAT_TEST_NUMBER']
assert repeat_test_number.isdigit(), 'REPEAT_TEST_NUMBER should be an integer > 0'
repeat_test_number = int(repeat_test_number)

if repeat_test_number > 1:
for i, test_case in enumerate(hpat_tests):
extended_tests = []
for test in test_case:
for _ in range(repeat_test_number):
extended_tests.append(test)
hpat_tests._tests[i]._tests = extended_tests

suite.addTests(hpat_tests)
return suite


Expand Down
5 changes: 3 additions & 2 deletions hpat/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ def test_impl():

pd.testing.assert_series_equal(hpat_func(), test_impl())

@unittest.skip("ERROR: Segmentation fault on the second launch (using REPEAT_TEST_NUMBER=2)")
def test_series_list_str_unbox1(self):
def test_impl(A):
return A.iloc[0]
Expand Down Expand Up @@ -1288,9 +1289,9 @@ def test_impl():
Exact errors:
1. Segmentation fault in TestBasic.test_rebalance
2. FAIL in TestBasic.test_astype with following error message:
test_astype (hpat.tests.test_basic.TestBasic) ...
test_astype (hpat.tests.test_basic.TestBasic) ...
Fatal error in MPI_Allreduce: Message truncated, error stack:
MPI_Allreduce(907)..................: MPI_Allreduce(sbuf=0x7ffe3b734128, rbuf=0x7ffe3b734120, count=1,
MPI_Allreduce(907)..................: MPI_Allreduce(sbuf=0x7ffe3b734128, rbuf=0x7ffe3b734120, count=1,
MPI_LONG_LONG_INT, MPI_SUM, MPI_COMM_WORLD) failed
MPIR_Allreduce_impl(764)............:
MPIR_Allreduce_intra(238)...........:
Expand Down

0 comments on commit 4084742

Please sign in to comment.