Skip to content

Commit

Permalink
[integration tests] handle long timeouts in storage checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jbygdell committed Aug 13, 2024
1 parent f30507a commit 0568531
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/integration/tests/sda/22_error_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ curl -k -u guest:guest "$URI/api/exchanges/sda/sda/publish" \
until [ "$(psql -U postgres -h postgres -d sda -At -c "SELECT event FROM sda.file_event_log WHERE correlation_id = '$CORRID' ORDER BY ID DESC LIMIT 1;")" = "error" ]; do
echo "waiting for file error to be logged by ingest"
RETRY_TIMES=$((RETRY_TIMES + 1))
if [ "$RETRY_TIMES" -eq 30 ]; then
if [ "$RETRY_TIMES" -eq 61 ]; then
echo "::error::Time out while waiting for ingest to set file error"
exit 1
fi
Expand Down Expand Up @@ -123,7 +123,7 @@ until [ "$(psql -U postgres -h postgres -d sda -At -c "SELECT event FROM sda.fil
echo "waiting for file error to be logged by verify"
date
RETRY_TIMES=$((RETRY_TIMES + 1))
if [ "$RETRY_TIMES" -eq 30 ]; then
if [ "$RETRY_TIMES" -eq 61 ]; then
echo "::error::Time out while waiting for verify to set file error"
exit 1
fi
Expand Down
14 changes: 9 additions & 5 deletions .github/integration/tests/sda/92_handle_file_errors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ curl -s -u guest:guest 'http://rabbitmq:15672/api/exchanges/sda/sda/publish' \

sleep 10


if [ $((stream_size++)) -eq "$(curl -s -u guest:guest http://rabbitmq:15672/api/queues/sda/error_stream | jq '.messages_ready')" ]; then
echo "missing file not moved to error"
exit 1
fi
RETRY_TIMES=0
until [ $((stream_size++)) -eq "$(curl -s -u guest:guest http://rabbitmq:15672/api/queues/sda/error_stream | jq '.messages_ready')" ]; do
RETRY_TIMES=$((RETRY_TIMES + 1))
if [ "$RETRY_TIMES" -eq 61 ]; then
echo "missing file not moved to error"
exit 1
fi
sleep 2
done

CORRID=$(
curl -s -X POST \
Expand Down

0 comments on commit 0568531

Please sign in to comment.