Skip to content

Commit f17cc18

Browse files
committed
ttcn3-bts-test: show respawn count at the end
As mentioned in the last commit, we currently must use respawn.sh to be able to recover from clock skew errors seen in jenkins. Let's display the respawn count at the end as warning. Related: OS#6794 Change-Id: I4e5c3dd46ec682bfd79f2328195b0050fe3f186d
1 parent 5342050 commit f17cc18

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

common/respawn.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SLEEP_BEFORE_RESPAWN=${SLEEP_BEFORE_RESPAWN:-0}
77
i=0
88
max_i=500
99
while [ $i -lt $max_i ]; do
10-
echo "$i: starting: $*"
10+
echo "respawn: $i: starting: $*"
1111
$* &
1212
LAST_PID=$!
1313
wait $LAST_PID

ttcn3-bts-test/jenkins.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,27 @@ start_config_hopping() {
229229
docker_kill_wait ${BUILD_TAG}-bts
230230
}
231231

232+
show_respawn_count() {
233+
set +x
234+
local count=$(grep -P 'respawn: \d+: starting: ' "$VOL_BASE_DIR"/bts/osmo-bts.log | wc -l)
235+
# Currently we run generic/bts/oml configurations, which means 3
236+
# restarts are expected.
237+
local count_exp=3
238+
239+
if [ "$count" = "$count_exp" ]; then
240+
echo "osmo-bts was respawned $count times (as expected)"
241+
return
242+
fi
243+
244+
printf '\033[0;31m' # set color to red
245+
echo
246+
echo "================================================================"
247+
echo " WARNING: osmo-bts was respawned $count times (expected: $count_exp)! (OS#6794)"
248+
echo "================================================================"
249+
echo
250+
printf '\033[0m'
251+
}
252+
232253
network_create
233254

234255
mkdir $VOL_BASE_DIR/bts-tester-generic
@@ -272,3 +293,7 @@ start_config_generic
272293
start_config_virtphy
273294
start_config_oml
274295
start_config_hopping
296+
297+
# Show respawn count at the very end
298+
clean_up_common
299+
show_respawn_count

0 commit comments

Comments
 (0)