forked from elgalu/docker-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript_scenario_restart
executable file
·41 lines (34 loc) · 1.24 KB
/
script_scenario_restart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# set -e: exit asap if a command exits with a non-zero status
# set -x: print each command right before it is executed
set -xe
SLEEP_RACE_COND_SECS=2
WAIT_ALL_DONE="40s"
if [ "${CI}" = "true" ]; then
SLEEP_RACE_COND_SECS=7 #to avoid issue #83
WAIT_ALL_DONE="200s"
fi
set +x
echo "#======================================"
echo "# Scenario 2a [restart]: Normal restart"
echo "#======================================"
set -x
docker restart grid #normal restart
# docker restart grid_mock #only needed when sharing the network interface
sleep ${SLEEP_RACE_COND_SECS}
docker exec grid wait_all_done ${WAIT_ALL_DONE}
docker logs grid
docker exec grid errors || true
docker exec -t grid run_test
set +x
echo "#========================================================================"
echo "# Scenario 2b [restart]: Forced quick container restart + run tests again"
echo "#========================================================================"
set -x
docker restart --time=0 grid #forced quick restart
# docker restart --time=0 grid_mock #only needed when sharing the network interface
sleep ${SLEEP_RACE_COND_SECS}
docker exec grid wait_all_done ${WAIT_ALL_DONE}
docker logs grid
docker exec grid errors || true
docker exec -t grid run_test