Skip to content

Commit e513395

Browse files
Merge pull request #13 from kamil-holubicki/DISTMYSQL-251
DISTMYSQL-251: Orchestrator tests fail with PS 8.0.30
2 parents 3f7a3a8 + 3be37a3 commit e513395

File tree

5 files changed

+59
-12
lines changed

5 files changed

+59
-12
lines changed

docker/Dockerfile.system

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN (cd /orchestrator/orchestrator-ci-env/bin/linux && ln -s /dbdeployer/dbdeplo
2727

2828
# For dev purposes only, just to avoid downloading over and over via download-mysql script
2929
# RUN (mkdir /orchestrator/orchestrator-ci-env/mysql-tarballs-downloaded)
30-
# COPY docker/Percona-Server-8.0.26-16-Linux.x86_64.glibc2.12-minimal.tar.gz /orchestrator/orchestrator-ci-env/mysql-tarballs-downloaded/
30+
# COPY docker/Percona-Server-8.0.30-22-Linux.x86_64.glibc2.17-minimal.tar.gz /orchestrator/orchestrator-ci-env/mysql-tarballs-downloaded/
3131

3232
RUN (cd /orchestrator/orchestrator-ci-env && cp bin/linux/systemctl.py /usr/bin/systemctl)
3333
RUN (cd /orchestrator/orchestrator-ci-env && script/deploy-haproxy)

run/test-system.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export CI_ENV_REPO=
77
export CI_ENV_BRANCH=
88

99
# Configure test run parameters
10-
export TARBALL_URL=https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.26-16/binary/tarball/Percona-Server-8.0.26-16-Linux.x86_64.glibc2.12-minimal.tar.gz
10+
export TARBALL_URL=https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.30-22/binary/tarball/Percona-Server-8.0.30-22-Linux.x86_64.glibc2.17-minimal.tar.gz
1111
export RUN_TESTS=YES
1212
export ALLOW_TESTS_FAILURES=YES
1313

tests/system/check_restore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
#!/bin/bash
22

3-
orchestrator-client -c topology-tabulated -alias ci | cut -d'|' -f 1,2,3
3+
# sed is to get rid of lag tag (Ns) part as it may fluctuate, but it does not affect tests.
4+
# "127.0.0.1:10112|1s|ok" -> "127.0.0.1:10112|LAG|ok"
5+
# It does not change "unknown", "detached" and other non-numeric values.
6+
orchestrator-client -c topology-tabulated -alias ci | sed -n "s/|[0-9]\+s|/|LAG|/p" | cut -d'|' -f 1,2,3

tests/system/expect_restore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
127.0.0.1:10111 |0s|ok
2-
+ 127.0.0.1:10112|0s|ok
3-
+ 127.0.0.1:10113|0s|ok
4-
+ 127.0.0.1:10114|0s|ok
1+
127.0.0.1:10111 |LAG|ok
2+
+ 127.0.0.1:10112|LAG|ok
3+
+ 127.0.0.1:10113|LAG|ok
4+
+ 127.0.0.1:10114|LAG|ok

tests/system/test.sh

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,40 +301,84 @@ should_attempt_test() {
301301
}
302302

303303
test_all() {
304+
local passed_cnt=0
305+
local unstable_cnt=0
306+
local failed_cnt=0
307+
local total_cnt=0
308+
local expected_cnt=`find $tests_path -mindepth 1 -maxdepth 1 ! -path . -type d | wc -l`
309+
304310
local test_pattern="${1:-.}"
305311

306312
echo "." > $tests_todo_file
307313
while [ -s $tests_todo_file ] ; do
308314
echo -n > $tests_todo_file
309-
310-
find $tests_path -mindepth 1 -maxdepth 1 ! -path . -type d | xargs ls -td1 | cut -d "/" -f 4 | egrep "$test_pattern" | while read test_name ; do
315+
while read test_name ; do
311316
if ! test_listed_as_attempted "$test_name" ; then
312317
echo "$test_name" >> $tests_todo_file
313318
fi
314319
if should_attempt_test "$test_name" "$test_pattern" ; then
315-
test_single "$test_name"
316-
if [ $? -eq 0 ] ; then
320+
# try up to 3 times. Some tests seem to be not stable
321+
322+
test_status="PASSED"
323+
for i in {1..3}
324+
do
325+
if [ ${i} -ne 1 ] ; then
326+
test_status="UNSTABLE"
327+
echo "Retrying test after failure (${i}/3). Testname: $test_name"
328+
# cleanup the state just in case
329+
bash $tests_path/deploy-replication || return 1
330+
fi
331+
test_single "$test_name"
332+
test_single_result=$?
333+
if [ $test_single_result -eq 0 ] ; then
334+
break
335+
fi
336+
done
337+
if [ $test_single_result -eq 0 ] ; then
338+
echo "Test finished. Testname: ${test_name} status: ${test_status}"
317339
echo "$test_name" >> $tests_successful_file
318340
else
319341
echo "$test_name" >> $tests_failed_file
342+
test_status="FAILED"
343+
echo "Test finished. Testname: ${test_name} status: ${test_status}"
320344
if [ "$ALLOW_TESTS_FAILURES" != "YES" ] ; then
321345
echo "Tests failures not allowed. Exiting."
322346
exit 1
323347
else
324348
echo "Tests failures allowed. Continuing."
349+
# cleanup the state just in case
350+
bash $tests_path/deploy-replication || return 1
325351
fi
326352
fi
353+
if [ "${test_status}" == "PASSED" ] ; then
354+
((passed_cnt++))
355+
elif [ "${test_status}" == "UNSTABLE" ] ; then
356+
((unstable_cnt++))
357+
elif [ "${test_status}" == "FAILED" ] ; then
358+
((failed_cnt++))
359+
else
360+
echo "Unexpected test_status: ${test_status}"
361+
fi
362+
((total_cnt++))
327363
else
328364
: # echo "# should not attempt $test_name"
329365
fi
330-
done || return 1
366+
done < <(find $tests_path -mindepth 1 -maxdepth 1 ! -path . -type d | xargs ls -td1 | cut -d "/" -f 4 | egrep "$test_pattern") || return 1
331367
done
332368
find $tests_path -mindepth 1 -maxdepth 1 ! -path . -type d | xargs ls -td1 | cut -d "/" -f 4 | egrep "$test_pattern" | while read test_name ; do
333369
if ! test_listed_as_attempted "$test_name" ; then
334370
echo "# ERROR: tests completed by $test_name seems to have been skipped"
335371
exit 1
336372
fi
337373
done || exit 1
374+
375+
echo "Test results:"
376+
echo "PASSED: ${passed_cnt}/${total_cnt}/${expected_cnt}"
377+
echo "UNSTABLE: ${unstable_cnt}/${total_cnt}/${expected_cnt}"
378+
echo "FAILED: ${failed_cnt}/${total_cnt}/${expected_cnt}"
379+
if [ ${total_cnt} -ne ${expected_cnt} ] ; then
380+
echo "WARNING! Some tests were skipped. Expected: ${expected_cnt}, executed: ${total_cnt}"
381+
fi
338382
}
339383

340384
main() {

0 commit comments

Comments
 (0)