Skip to content

Commit

Permalink
ci-benchmark: switch final checks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alxndrsn committed Oct 13, 2022
1 parent 0c19dfc commit 8e33919
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions benchmarker/scripts/ci-benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand Down

0 comments on commit 8e33919

Please sign in to comment.