Skip to content

Commit f6c34d0

Browse files
committed
[tests] check that an extra message is sent
One extra message for deletion of the overwritten file is expected.
1 parent 47bdb97 commit f6c34d0

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

Diff for: .github/integration/tests/sda/10_upload_test.sh

+18-5
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ done
3333
## reupload a file under a different name
3434
s3cmd -c s3cfg put NA12878.bam.c4gh s3://test_dummy.org/NB12878.bam.c4gh
3535

36-
## reupload a file with the same name
37-
s3cmd -c s3cfg put NA12878.bam.c4gh s3://test_dummy.org/
38-
39-
4036
echo "waiting for upload to complete"
4137
RETRY_TIMES=0
42-
until [ "$(curl -s -k -u guest:guest $URI/api/queues/sda/inbox | jq -r '."messages_ready"')" -eq 6 ]; do
38+
until [ "$(curl -s -k -u guest:guest $URI/api/queues/sda/inbox | jq -r '."messages_ready"')" -eq 5 ]; do
4339
echo "waiting for upload to complete"
4440
RETRY_TIMES=$((RETRY_TIMES + 1))
4541
if [ "$RETRY_TIMES" -eq 30 ]; then
@@ -49,6 +45,23 @@ until [ "$(curl -s -k -u guest:guest $URI/api/queues/sda/inbox | jq -r '."messag
4945
sleep 2
5046
done
5147

48+
## reupload a file with the same name
49+
s3cmd -c s3cfg put NA12878.bam.c4gh s3://test_dummy.org/
50+
51+
## expect 2 new messages, one for deletion of the overwritten file, one for the new upload
52+
echo "waiting for re-upload to complete"
53+
RETRY_TIMES=0
54+
until [ "$(curl -s -k -u guest:guest $URI/api/queues/sda/inbox | jq -r '."messages_ready"')" -eq 7 ]; do
55+
echo "waiting for re-upload to complete"
56+
RETRY_TIMES=$((RETRY_TIMES + 1))
57+
if [ "$RETRY_TIMES" -eq 30 ]; then
58+
echo "::error::Time out while waiting for re-upload to complete"
59+
exit 1
60+
fi
61+
sleep 2
62+
done
63+
64+
5265
num_rows=$(psql -U postgres -h postgres -d sda -At -c "SELECT COUNT(*) from sda.files;")
5366
if [ "$num_rows" -ne 5 ]; then
5467
echo "database queries for register_files failed, expected 5 got $num_rows"

0 commit comments

Comments
 (0)