[Qa-jenkins-scm] [jenkins.debian.net] 06/07: torbrowser tests: refactor, sleep less first, later more
Holger Levsen
holger at moszumanska.debian.org
Thu Nov 19 10:25:57 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit cb7453e3bccd56e42609de8b1e1f76a339cd96cf
Author: Holger Levsen <holger at layer-acht.org>
Date: Thu Nov 19 03:29:28 2015 +0100
torbrowser tests: refactor, sleep less first, later more
---
bin/test_torbrowser-launcher.sh | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/bin/test_torbrowser-launcher.sh b/bin/test_torbrowser-launcher.sh
index 9f32182..158c1d5 100755
--- a/bin/test_torbrowser-launcher.sh
+++ b/bin/test_torbrowser-launcher.sh
@@ -189,10 +189,11 @@ download_and_launch() {
cleanup_duplicate_screenshots
exit 1
fi
- # allow the download to take up to 15 minutes
+ # allow the download to take up to ~15 minutes (891 seconds)
+ # ( echo -n "0" ; for i in $(seq 1 33) ; do echo -n "+$i+10" ; done ; echo ) | bc
# we watch the download directory and parse torbrowser-launchers stdout, so usually this loop won't run this long
- for i in $(seq 1 60) ; do
- sleep 15
+ for i in $(seq 1 33) ; do
+ sleep 10 ; sleep $i
STATUS="$(grep '^Download error:' $TBL_LOGFILE || true)"
if [ -n "$STATUS" ] ; then
echo "'$(date -u) - $STATUS'" | tee | xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send -u critical
@@ -219,9 +220,9 @@ download_and_launch() {
exit 1
fi
echo "$(date -u) - waiting for torbrowser to start."
- # allow up to 60 seconds for torbrowser to start
- for i in $(seq 1 6) ; do
- sleep 10
+ # allow up to 63 seconds for torbrowser to start
+ for i in $(seq 1 7) ; do
+ sleep 5 ; sleep $i
# this directory only exists once torbrower has successfully started
# (and pattern matching doesnt work because of schroot…)
local BROWSER_PROFILE=TorBrowser/Data/Browser/profile.default
@@ -242,8 +243,9 @@ download_and_launch() {
xvkbd -text "\r" > /dev/null 2>&1
sleep 3
update_screenshot
- for i in $(seq 1 6) ; do
- sleep 10
+ # allow up to 63 seconds for torbrowser to make the first connection through tor
+ for i in $(seq 1 7) ; do
+ sleep 5 ; sleep $i
update_screenshot
TOR_RUNNING=$(gocr $WORKSPACE/screenshot.png 2>/dev/null | egrep "(Search securely|Tor Is NOT all you need to browse|There are many ways you can help)" || true)
if [ -n "$TOR_RUNNING" ] ; then
@@ -268,8 +270,9 @@ download_and_launch() {
sleep 1
xvkbd -text "\r" > /dev/null 2>&1
sleep 2
- for i in $(seq 1 6) ; do
- sleep 5
+ # allow up up to 30 seconds to load the url
+ for i in $(seq 1 4) ; do
+ sleep 5 ; sleep $i
URL_LOADED=$(gocr $WORKSPACE/screenshot.png 2>/dev/null | grep -c -i "README" || true)
update_screenshot
if [ $URL_LOADED -ge 4 ] ; then
@@ -287,8 +290,9 @@ download_and_launch() {
sleep 1
xvkbd -text "\r" > /dev/null 2>&1
sleep 2
- for i in $(seq 1 6) ; do
- sleep 5
+ # allow up up to 30 seconds to load the url
+ for i in $(seq 1 4) ; do
+ sleep 5 ; sleep $i
URL_LOADED=$(gocr $WORKSPACE/screenshot.png 2>/dev/null | grep -c "Debian" || true)
update_screenshot
if [ $URL_LOADED -ge 6 ] ; then
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list