From 5b3a1bd65c6f563b71c2a014a631f5d69521ceae Mon Sep 17 00:00:00 2001 From: "pieths.dev@gmail.com" Date: Tue, 7 Jan 2020 16:00:43 -0800 Subject: [PATCH 1/5] Run failed unit tests a second time on Ubuntu/Mac to fix intermittent crashes. --- build.sh | 3 ++- src/python/nimbusml/tests/test_csr_matrix_output.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index b964a54f..92596b67 100755 --- a/build.sh +++ b/build.sh @@ -307,7 +307,8 @@ then TestsPath2=${__currentScriptDir}/src/python/tests TestsPath3=${__currentScriptDir}/src/python/tests_extended ReportPath=${__currentScriptDir}/build/TestCoverageReport - "${PythonExe}" -m pytest -n 4 --verbose --maxfail=1000 --capture=sys "${TestsPath2}" "${TestsPath1}" + "${PythonExe}" -m pytest -n 4 --verbose --maxfail=1000 --capture=sys "${TestsPath2}" "${TestsPath1}" || \ + "${PythonExe}" -m pytest -n 4 --last-failed --verbose --maxfail=1000 --capture=sys "${TestsPath2}" "${TestsPath1}" if [ ${__runExtendedTests} = true ] then diff --git a/src/python/nimbusml/tests/test_csr_matrix_output.py b/src/python/nimbusml/tests/test_csr_matrix_output.py index f4909906..af4549f2 100644 --- a/src/python/nimbusml/tests/test_csr_matrix_output.py +++ b/src/python/nimbusml/tests/test_csr_matrix_output.py @@ -35,6 +35,8 @@ def test_column_dropped_output_produces_expected_result(self): self.assertTrue(result.equals(expected_result)) + self.fail('Forced failure to test pytest restart.') + def test_fit_transform_produces_expected_result(self): train_data = {'c1': [1, 0, 0, 4], 'c2': [2, 3, 0, 5], From dad8490875950cc1b7d30843580caf5d2d915517 Mon Sep 17 00:00:00 2001 From: "pieths.dev@gmail.com" Date: Tue, 7 Jan 2020 18:10:48 -0800 Subject: [PATCH 2/5] Remove intentional failure from testing code. --- src/python/nimbusml/tests/test_csr_matrix_output.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/python/nimbusml/tests/test_csr_matrix_output.py b/src/python/nimbusml/tests/test_csr_matrix_output.py index af4549f2..f4909906 100644 --- a/src/python/nimbusml/tests/test_csr_matrix_output.py +++ b/src/python/nimbusml/tests/test_csr_matrix_output.py @@ -35,8 +35,6 @@ def test_column_dropped_output_produces_expected_result(self): self.assertTrue(result.equals(expected_result)) - self.fail('Forced failure to test pytest restart.') - def test_fit_transform_produces_expected_result(self): train_data = {'c1': [1, 0, 0, 4], 'c2': [2, 3, 0, 5], From 07d69936e3e25d3b3daefc4975b2c40b744efe09 Mon Sep 17 00:00:00 2001 From: "pieths.dev@gmail.com" Date: Wed, 8 Jan 2020 10:49:00 -0800 Subject: [PATCH 3/5] Test forced intermittent failure. --- src/python/nimbusml/tests/test_csr_matrix_output.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/python/nimbusml/tests/test_csr_matrix_output.py b/src/python/nimbusml/tests/test_csr_matrix_output.py index f4909906..d238cdd2 100644 --- a/src/python/nimbusml/tests/test_csr_matrix_output.py +++ b/src/python/nimbusml/tests/test_csr_matrix_output.py @@ -35,6 +35,15 @@ def test_column_dropped_output_produces_expected_result(self): self.assertTrue(result.equals(expected_result)) + import os + filename = 'csr_test_executed' + if not os.path.exists(filename): + with open(filename, 'a'): + os.utime(filename, None) + + self.fail('Forced failure to test restart functionality on Mac/Linux') + + def test_fit_transform_produces_expected_result(self): train_data = {'c1': [1, 0, 0, 4], 'c2': [2, 3, 0, 5], From a2c94392bf66e19a74821676a46b04d06bcd87fe Mon Sep 17 00:00:00 2001 From: "pieths.dev@gmail.com" Date: Wed, 8 Jan 2020 11:19:12 -0800 Subject: [PATCH 4/5] Remove intentional test failure. --- src/python/nimbusml/tests/test_csr_matrix_output.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/python/nimbusml/tests/test_csr_matrix_output.py b/src/python/nimbusml/tests/test_csr_matrix_output.py index d238cdd2..f4909906 100644 --- a/src/python/nimbusml/tests/test_csr_matrix_output.py +++ b/src/python/nimbusml/tests/test_csr_matrix_output.py @@ -35,15 +35,6 @@ def test_column_dropped_output_produces_expected_result(self): self.assertTrue(result.equals(expected_result)) - import os - filename = 'csr_test_executed' - if not os.path.exists(filename): - with open(filename, 'a'): - os.utime(filename, None) - - self.fail('Forced failure to test restart functionality on Mac/Linux') - - def test_fit_transform_produces_expected_result(self): train_data = {'c1': [1, 0, 0, 4], 'c2': [2, 3, 0, 5], From 9a6fb7b38359b1403c8380bb4789fb6ff3b3c180 Mon Sep 17 00:00:00 2001 From: "pieths.dev@gmail.com" Date: Wed, 8 Jan 2020 11:39:18 -0800 Subject: [PATCH 5/5] Whitespace change to restart CI. This fix does not deal with hung build pipelines. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 92596b67..2e6b7d7f 100755 --- a/build.sh +++ b/build.sh @@ -308,7 +308,7 @@ then TestsPath3=${__currentScriptDir}/src/python/tests_extended ReportPath=${__currentScriptDir}/build/TestCoverageReport "${PythonExe}" -m pytest -n 4 --verbose --maxfail=1000 --capture=sys "${TestsPath2}" "${TestsPath1}" || \ - "${PythonExe}" -m pytest -n 4 --last-failed --verbose --maxfail=1000 --capture=sys "${TestsPath2}" "${TestsPath1}" + "${PythonExe}" -m pytest -n 4 --last-failed --verbose --maxfail=1000 --capture=sys "${TestsPath2}" "${TestsPath1}" if [ ${__runExtendedTests} = true ] then