From 0446220e0143afd9a6fafe600c645d9fd010333f Mon Sep 17 00:00:00 2001 From: Lei Wang Date: Wed, 9 May 2018 16:54:37 -0700 Subject: [PATCH] CI: rerun failed tests. (#10536) * CI: rerun failed tests. * fix check style error. --- paddle/fluid/inference/tensorrt/test_engine.cc | 2 +- paddle/scripts/docker/build.sh | 7 +++++++ paddle/scripts/paddle_build.sh | 8 ++++++++ paddle/scripts/paddle_docker_build.sh | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/inference/tensorrt/test_engine.cc b/paddle/fluid/inference/tensorrt/test_engine.cc index 69dbb9a3f2b..e635f0f87d5 100644 --- a/paddle/fluid/inference/tensorrt/test_engine.cc +++ b/paddle/fluid/inference/tensorrt/test_engine.cc @@ -98,7 +98,7 @@ TEST_F(TensorRTEngineTest, add_layer_multi_dim) { float x_v[2] = {1.0, 2.0}; engine_->SetInputFromCPU("x", reinterpret_cast(&x_v), - 2 * sizeof(float)); + 2 * sizeof(float)); engine_->Execute(1); LOG(INFO) << "to get output"; diff --git a/paddle/scripts/docker/build.sh b/paddle/scripts/docker/build.sh index 7e00bd38487..c63b57ce40e 100755 --- a/paddle/scripts/docker/build.sh +++ b/paddle/scripts/docker/build.sh @@ -100,7 +100,14 @@ function run_test() { Running unit tests ... ======================================== EOF + set +e ctest --output-on-failure + if [ $? != 0 ]; then + set -e + ctest --output-on-failure --rerun-failed + set +e + fi + set -e # make install should also be test when unittest make install -j `nproc` pip install /usr/local/opt/paddle/share/wheels/*.whl diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 1595cc9e8aa..245b580bdff 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -299,7 +299,14 @@ function run_test() { Running unit tests ... ======================================== EOF + set +e ctest --output-on-failure + if [ $? != 0 ]; then + set -e + ctest --output-on-failure --rerun-failed + set +e + fi + set -e # make install should also be test when unittest make install -j `nproc` pip install /usr/local/opt/paddle/share/wheels/*.whl @@ -467,6 +474,7 @@ EOF } function main() { + set -e local CMD=$1 init case $CMD in diff --git a/paddle/scripts/paddle_docker_build.sh b/paddle/scripts/paddle_docker_build.sh index ddae9f19a21..7f5f7902bb7 100755 --- a/paddle/scripts/paddle_docker_build.sh +++ b/paddle/scripts/paddle_docker_build.sh @@ -59,7 +59,7 @@ EOL if [ ! -d "${HOME}/.ccache" ]; then mkdir ${HOME}/.ccache fi - set -x + set -ex ${DOCKER_CMD} run -it \ --name $CONTAINER_ID \ ${DOCKER_ENV} \ -- GitLab