diff --git a/ci/docker/install/ubuntu_nightly_tests.sh b/ci/docker/install/ubuntu_nightly_tests.sh index 68358908bdc9..406985ea3a4a 100755 --- a/ci/docker/install/ubuntu_nightly_tests.sh +++ b/ci/docker/install/ubuntu_nightly_tests.sh @@ -32,5 +32,5 @@ apt-get -y install time apt-get install -y subversion maven -y #>/dev/null # Packages needed for the Straight Dope Nightly tests. -pip2 install pandas scikit-image -pip3 install pandas scikit-image +pip2 install pandas scikit-image prompt_toolkit +pip3 install pandas scikit-image prompt_toolkit diff --git a/tests/nightly/straight_dope/test_notebooks_single_gpu.py b/tests/nightly/straight_dope/test_notebooks_single_gpu.py index 5eeb52f516e1..fc3a4f240ddc 100644 --- a/tests/nightly/straight_dope/test_notebooks_single_gpu.py +++ b/tests/nightly/straight_dope/test_notebooks_single_gpu.py @@ -35,13 +35,11 @@ 'chapter02_supervised-learning/environment', 'chapter03_deep-neural-networks/kaggle-gluon-kfold', 'chapter04_convolutional-neural-networks/deep-cnns-alexnet', # > 10 mins. - 'chapter05_recurrent-neural-networks/rnns-gluon', # > 10 mins. 'chapter06_optimization/gd-sgd-scratch', # Overflow warning is intended. 'chapter06_optimization/gd-sgd-gluon', # Overflow warning is intended. 'chapter07_distributed-learning/multiple-gpus-scratch', 'chapter07_distributed-learning/multiple-gpus-gluon', 'chapter07_distributed-learning/training-with-multiple-machines', - 'chapter08_computer-vision/visual-question-answer', # > 10 mins. 'chapter11_recommender-systems/intro-recommender-systems', # Early draft, non-working. 'chapter12_time-series/intro-forecasting-gluon', 'chapter12_time-series/intro-forecasting-2-gluon', @@ -178,6 +176,9 @@ def test_lstm_scratch(self): def test_gru_scratch(self): assert _test_notebook('chapter05_recurrent-neural-networks/gru-scratch') + def test_rnn_gluon(self): + assert _test_notebook('chapter05_recurrent-neural-networks/rnns-gluon') + # Chapter 6 def test_optimization_intro(self): @@ -227,6 +228,10 @@ def test_object_detection(self): def test_fine_tuning(self): assert _test_notebook('chapter08_computer-vision/fine-tuning') + def test_visual_qa(self): + assert _test_notebook('chapter08_computer-vision/visual-question-answer') + + # Chapter 9 def test_tree_lstm(self): diff --git a/tests/utils/notebook_test/__init__.py b/tests/utils/notebook_test/__init__.py index 25e96ab0fc55..a32c5269b812 100644 --- a/tests/utils/notebook_test/__init__.py +++ b/tests/utils/notebook_test/__init__.py @@ -32,7 +32,7 @@ IPYTHON_VERSION = 4 # Pin to ipython version 4. TIME_OUT = 10*60 # Maximum 10 mins/test. Reaching timeout causes test failure. -RETRIES = 8 +ATTEMPTS = 8 KERNEL_ERROR_MSG = 'Kernel died before replying to kernel_info' @@ -80,23 +80,28 @@ def run_notebook(notebook, notebook_dir, kernel=None, no_cache=False, temp_dir=' else: eprocessor = ExecutePreprocessor(timeout=TIME_OUT) + success = False # There is a low (< 1%) chance that starting a notebook executor will fail due to the kernel # taking to long to start, or a port collision, etc. - for i in range(RETRIES): + for i in range(ATTEMPTS): try: nb, _ = eprocessor.preprocess(notebook, {'metadata': {'path': working_dir}}) + success = True except RuntimeError as rte: # We check if the exception has to do with the Jupyter kernel failing to start. If - # not, we rethrow to prevent the notebook from erring RETRIES times. It is not ideal - # to inspect the exception message, but necessary for retry logic, as Jupyter client - # throws the generic RuntimeError that can be confused with other Runtime errors. + # not, we rethrow to prevent the notebook from erring ATTEMPTS times. It is not + # ideal to inspect the exception message, but necessary for retry logic, as Jupyter + # client throws the generic RuntimeError that can be confused with other Runtime + # errors. if str(rte) != KERNEL_ERROR_MSG: raise rte - logging.info("Error starting preprocessor: {}. Attempt {}/{}".format(str(rte), i+1, RETRIES)) + logging.info("Error starting preprocessor: {}. Attempt {}/{}".format(str(rte), i+1, ATTEMPTS)) time.sleep(1) continue break + if not success: + errors.append("Error: Notebook failed to run after {} attempts.".format(ATTEMPTS)) except Exception as err: err_msg = str(err) errors.append(err_msg)