From 8e3391924c0c511c4d9589122d16c7309e924ec5 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Tue, 11 Oct 2022 15:09:20 +0300 Subject: [PATCH] ci-benchmark: switch final checks Streams should time out after 2 minutes of inactivity, so we should wait for that before deciding if backend is correctly responding to login requests. --- benchmarker/scripts/ci-benchmark | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmarker/scripts/ci-benchmark b/benchmarker/scripts/ci-benchmark index 136b906f1..3f127bec5 100755 --- a/benchmarker/scripts/ci-benchmark +++ b/benchmarker/scripts/ci-benchmark @@ -35,22 +35,22 @@ if ! curl -s -o /dev/null "$serverUrl"; then fail_job fi +log 'Checking open DB query count...' +timeout 120 bash -c "cd ..; while ! node lib/bin/check-open-db-queries.js; do sleep 1; done" + +log 'Checking backend is serving requests...' responseLog="$(mktemp)" requestBody='{"email":"'"$userEmail"'","password":"'"$userPassword"'"}' loginStatus="$(curl -s -o "$responseLog" -w '%{http_code}' \ --header 'Content-Type: application/json' --data "$requestBody" \ "$serverUrl/v1/sessions" )" -if [[ "$loginStatus" = "200" ]]; then - log 'Backend survived; job should pass.' -else +if [[ "$loginStatus" != "200" ]]; then log 'Backend behaving badly:' log "$(cat "$responseLog")" fail_job fi - -log 'Checking open DB query count...' -timeout 120 bash -c "cd ..; while ! node lib/bin/check-open-db-queries.js; do sleep 1; done" +log 'Backend survived; job passed.' # TODO upload results to getodk.cloud for graphing. Include: #