aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah Rumancik <leah.rumancik@gmail.com>2023-02-13 12:21:44 -0800
committerLeah Rumancik <leah.rumancik@gmail.com>2023-02-15 15:34:37 -0800
commit9e67ddbbede1eb9fc766fc2c2e642a890a4db915 (patch)
tree6172f6f2ea6796f3dbabd670747f607b567cfe6c
parent438ff0e78f84942d10227e74a02383439a34f183 (diff)
downloadxfstests-bld-9e67ddbbede1eb9fc766fc2c2e642a890a4db915.tar.gz
gce-logger: force status metadata update on first test
I was running into an issue where early test crashes caused noStatusTimeout to hit. gce-logger was sending the metadata update comand at the start of the test but it was not completing before the test crashed causing a reboot. To fix this and prevent false positives with noStatusTimeout, wait for the status metadata update to finish when running the first xfstest. Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
-rwxr-xr-xtest-appliance/files/root/runtests.sh1
-rwxr-xr-xtest-appliance/files/usr/local/lib/gce-logger8
2 files changed, 8 insertions, 1 deletions
diff --git a/test-appliance/files/root/runtests.sh b/test-appliance/files/root/runtests.sh
index 81fde2e1..038fe8fc 100755
--- a/test-appliance/files/root/runtests.sh
+++ b/test-appliance/files/root/runtests.sh
@@ -304,6 +304,7 @@ else
fi
touch "$RESULTS/fstest-completed"
+rm -f /run/last_logged
./check --help > /tmp/check-help
report_fmt=xunit
diff --git a/test-appliance/files/usr/local/lib/gce-logger b/test-appliance/files/usr/local/lib/gce-logger
index 9420df17..4eadca31 100755
--- a/test-appliance/files/usr/local/lib/gce-logger
+++ b/test-appliance/files/usr/local/lib/gce-logger
@@ -6,9 +6,11 @@ then
run_hooks logger "$*"
fi
+is_test=
status=$(echo "$*" | sed -e 's/^run xfstest //')
if echo "$*" | grep -q "^run xfstest "
then
+ is_test="y"
echo "$status" >> $RESULT_BASE/completed
if test ! -f $RESULT_BASE/rpt_status -o \
@@ -37,7 +39,11 @@ then
status="$cfg $status"
fi
-if test -z "$(find /run/last_logged -mmin -1 -print 2> /dev/null)"
+# force first test to upload it's test status and wait for it to finish
+if test -n "$is_test" -a ! -s /run/last_logged; then
+ /usr/local/lib/gce-add-metadata "status=$(date +%H:%M) $status"
+ echo "Started testing" > /run/last_logged
+elif test -z "$(find /run/last_logged -mmin -1 -print 2> /dev/null)"
then
/usr/local/lib/gce-add-metadata "status=$(date +%H:%M) $status" &
touch /run/last_logged