From e869c6ab84a7a27c3cf0b16f212263462e000fea Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 21 Feb 2022 15:01:31 +0100 Subject: [PATCH] schutzbot: keep runners alive when users are logged on For troubleshooting in CI, if a user is logged on to a runner, keep it alive until they are logged off. --- schutzbot/update_github_status.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/schutzbot/update_github_status.sh b/schutzbot/update_github_status.sh index 99f0291ad..5093ced8e 100755 --- a/schutzbot/update_github_status.sh +++ b/schutzbot/update_github_status.sh @@ -6,6 +6,12 @@ if [[ "$CI_PIPELINE_SOURCE" == "schedule" ]]; then exit 0 fi +# if a user is logged in to the runner, wait until they're done +while (( $(who -s | wc -l) > 0 )); do + echo "Waiting for user(s) to log off" + sleep 30 +done + if [[ $1 == "start" ]]; then GITHUB_NEW_STATE="pending" GITHUB_NEW_DESC="I'm currently testing this commit, be patient."