Skip to content

Commit e5d0665

Browse files
committed
Add env var for server unit test parallelism
We also ensure that for now TravisCI runs server tests serially to avoid not emitting output for more than ten minutes triggering the TravisCI auto kill feature.
1 parent ed6748b commit e5d0665

File tree

2 files changed

+29
-20
lines changed

2 files changed

+29
-20
lines changed

.travis.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
dist: xenial
22
language: perl
33
perl:
4-
- "5.28"
5-
- "5.26"
6-
- "5.24"
7-
- "5.22"
8-
- "5.20"
9-
- "5.18"
10-
- "5.16"
11-
- "5.10"
4+
- "5.28"
5+
- "5.26"
6+
- "5.24"
7+
- "5.22"
8+
- "5.20"
9+
- "5.18"
10+
- "5.16"
11+
- "5.10"
1212
before_install:
13-
- sudo apt-get update
13+
- sudo apt-get update
1414
install:
15-
- sudo apt-get install python python-pip bc libjson-perl libswitch-perl realpath
16-
- sudo pip install configtools elasticsearch
17-
- sudo apt-get install python-software-properties
18-
- sudo add-apt-repository ppa:fkrull/deadsnakes -y
19-
- sudo apt-get update
20-
- sudo apt-get install python3.6 --force-yes -y
21-
- sudo wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
22-
- sudo python3.6 /tmp/get-pip.py
23-
- sudo pip install 'configtools<0.4.0' elasticsearch
24-
- sudo ln -sf python3.6 /usr/bin/python3
15+
- sudo apt-get install python python-pip bc libjson-perl libswitch-perl realpath
16+
- sudo pip install configtools elasticsearch
17+
- sudo apt-get install python-software-properties
18+
- sudo add-apt-repository ppa:fkrull/deadsnakes -y
19+
- sudo apt-get update
20+
- sudo apt-get install python3.6 --force-yes -y
21+
- sudo wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
22+
- sudo python3.6 /tmp/get-pip.py
23+
- sudo pip install 'configtools<0.4.0' elasticsearch
24+
- sudo ln -sf python3.6 /usr/bin/python3
25+
env:
26+
- PBENCH_UNITTEST_SERVER_MODE=serial
2527
script:
26-
- ./run-unittests
28+
- ./run-unittests

server/bin/unittests

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,9 @@ declare -A cmds=(
644644
all_tests_sorted=$(for x in ${!cmds[@]} ;do echo $x ;done | sed 's/\./-/' | sort -n -t '-' -k 3 | sort -n -t '-' -k 2 --stable | sed 's/\(.*-[0-9]\)-\([0-9]\)/\1.\2/')
645645

646646
mode="serial"
647+
if [[ -n "$PBENCH_UNITTEST_SERVER_MODE" ]]; then
648+
mode="$PBENCH_UNITTEST_SERVER_MODE"
649+
fi
647650
case $1 in
648651
--serial)
649652
shift
@@ -658,6 +661,10 @@ case $1 in
658661
exit 1
659662
;;
660663
esac
664+
if [[ "$mode" != "serial" && "$mode" != "parallel" ]]; then
665+
printf "Bad server unit test mode \"$mode\", choose either 'serial' or 'parallel'\n" >&2
666+
exit 1
667+
fi
661668

662669
test_args=$*
663670
if [ -z "$test_args" ] ;then

0 commit comments

Comments
 (0)