Skip to content

Commit 0446220

Browse files
authored
CI: rerun failed tests. (#10536)
* CI: rerun failed tests. * fix check style error.
1 parent 0fed3db commit 0446220

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

paddle/fluid/inference/tensorrt/test_engine.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ TEST_F(TensorRTEngineTest, add_layer_multi_dim) {
9898

9999
float x_v[2] = {1.0, 2.0};
100100
engine_->SetInputFromCPU("x", reinterpret_cast<void*>(&x_v),
101-
2 * sizeof(float));
101+
2 * sizeof(float));
102102
engine_->Execute(1);
103103

104104
LOG(INFO) << "to get output";

paddle/scripts/docker/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@ function run_test() {
100100
Running unit tests ...
101101
========================================
102102
EOF
103+
set +e
103104
ctest --output-on-failure
105+
if [ $? != 0 ]; then
106+
set -e
107+
ctest --output-on-failure --rerun-failed
108+
set +e
109+
fi
110+
set -e
104111
# make install should also be test when unittest
105112
make install -j `nproc`
106113
pip install /usr/local/opt/paddle/share/wheels/*.whl

paddle/scripts/paddle_build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,14 @@ function run_test() {
299299
Running unit tests ...
300300
========================================
301301
EOF
302+
set +e
302303
ctest --output-on-failure
304+
if [ $? != 0 ]; then
305+
set -e
306+
ctest --output-on-failure --rerun-failed
307+
set +e
308+
fi
309+
set -e
303310
# make install should also be test when unittest
304311
make install -j `nproc`
305312
pip install /usr/local/opt/paddle/share/wheels/*.whl
@@ -467,6 +474,7 @@ EOF
467474
}
468475

469476
function main() {
477+
set -e
470478
local CMD=$1
471479
init
472480
case $CMD in

paddle/scripts/paddle_docker_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ EOL
5959
if [ ! -d "${HOME}/.ccache" ]; then
6060
mkdir ${HOME}/.ccache
6161
fi
62-
set -x
62+
set -ex
6363
${DOCKER_CMD} run -it \
6464
--name $CONTAINER_ID \
6565
${DOCKER_ENV} \

0 commit comments

Comments
 (0)