File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ jobs:
250250 TESTS=$(printf '%s\n' "${ary[@]}" | tr '\n' ' ')
251251 # Retry up to three times
252252 for i in {1..3}; do
253- HWSIM_RES=0
253+ HWSIM_RES=0 # Not set when command succeeds
254254 # Logs can grow quickly especially in debug mode
255255 sudo rm -rf logs
256256 sudo ./start.sh
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ if [ -z " $GITHUB_WORKSPACE " ]; then
4+ echo ' $GITHUB_WORKSPACE is not set'
5+ exit 1
6+ fi
7+
8+ if [ -z " $HOST_ROOT " ]; then
9+ echo ' $HOST_ROOT is not set'
10+ exit 1
11+ fi
12+
13+ chroot $HOST_ROOT make -C $GITHUB_WORKSPACE /memcached \
14+ -j$( nproc) PARALLEL=$( nproc) test_tls
Original file line number Diff line number Diff line change 1616 configure : --enable-memcached
1717 install : true
1818
19+ - name : Bundle Docker entry point
20+ run : cp wolfssl/.github/workflows/memcached.sh build-dir/bin
21+
1922 - name : Upload built lib
2023 uses : actions/upload-artifact@v3
2124 with :
7780 - name : Run memcached tests
7881 working-directory : ./memcached
7982 run : |
80- export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
81- make -j$(nproc) PARALLEL=$(nproc) test_tls
83+ # Retry up to three times
84+ # Using docker because interrupting the tests doesn't close running
85+ # background servers. They can become daemonized and then all re-runs
86+ # will always fail.
87+ chmod +x $GITHUB_WORKSPACE/build-dir/bin/memcached.sh
88+ for i in {1..3}; do
89+ echo "-------- RUNNING TESTS --------"
90+ MEMCACHED_RES=0 # Not set when command succeeds
91+ # Tests should usually take less than 4 minutes. If already taking
92+ # 5 minutes then they are probably stuck. Interrupt and re-run.
93+ time timeout -s SIGKILL 5m docker run -v /:/host \
94+ -v $GITHUB_WORKSPACE/build-dir/bin/memcached.sh:/memcached.sh \
95+ -e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
96+ -e HOST_ROOT=/host \
97+ -e LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH \
98+ alpine:latest /memcached.sh || MEMCACHED_RES=$?
99+
100+ if [ "$MEMCACHED_RES" -eq "0" ]; then
101+ break
102+ fi
103+ done
104+ echo "test ran $i times"
105+ if [ "$MEMCACHED_RES" -ne "0" ]; then
106+ exit $MEMCACHED_RES
107+ fi
You can’t perform that action at this time.
0 commit comments