Permalink
Please
sign in to comment.
Browse files
Add integration tests; check other places where 429 could occur
- Loading branch information...
Showing
with
182 additions
and 39 deletions.
- +17 −9 errors/types.go
- +3 −12 lfshttp/errors.go
- +62 −2 t/cmd/lfstest-gitserver.go
- +70 −0 t/t-batch-retries-ratelimit.sh
- +9 −0 tq/basic_download.go
- +6 −0 tq/basic_upload.go
- +15 −16 tq/transfer_queue.go
| @@ -0,0 +1,70 @@ | |||
| #!/usr/bin/env bash | |||
|
|
|||
| . "$(dirname "$0")/testlib.sh" | |||
|
|
|||
| begin_test "batch storage upload causes retries" | |||
| ( | |||
| set -e | |||
|
|
|||
| reponame="batch-storage-upload-retry-later" | |||
| setup_remote_repo "$reponame" | |||
| clone_repo "$reponame" batch-storage-repo-upload | |||
|
|
|||
| contents="storage-upload-retry-later" | |||
| oid="$(calc_oid "$contents")" | |||
| printf "%s" "$contents" > a.dat | |||
|
|
|||
| git lfs track "*.dat" | |||
| git add .gitattributes a.dat | |||
| git commit -m "initial commit" | |||
|
|
|||
| GIT_TRACE=1 git push origin master 2>&1 | tee push.log | |||
| if [ "0" -ne "${PIPESTATUS[0]}" ]; then | |||
| echo >&2 "fatal: expected \`git push origin master\` to succeed ..." | |||
| exit 1 | |||
| fi | |||
|
|
|||
| assert_server_object "$reponame" "$oid" | |||
| ) | |||
| end_test | |||
|
|
|||
| begin_test "batch storage download causes retries" | |||
| ( | |||
| set -e | |||
|
|
|||
| reponame="batch-storage-download-retry-later" | |||
| setup_remote_repo "$reponame" | |||
| clone_repo "$reponame" batch-storage-repo-download | |||
|
|
|||
| contents="storage-download-retry-later" | |||
| oid="$(calc_oid "$contents")" | |||
| printf "%s" "$contents" > a.dat | |||
|
|
|||
| git lfs track "*.dat" | |||
| git add .gitattributes a.dat | |||
| git commit -m "initial commit" | |||
|
|
|||
| git push origin master | |||
| assert_server_object "$reponame" "$oid" | |||
|
|
|||
| pushd .. | |||
| git \ | |||
| -c "filter.lfs.process=" \ | |||
| -c "filter.lfs.smudge=cat" \ | |||
| -c "filter.lfs.required=false" \ | |||
| clone "$GITSERVER/$reponame" "$reponame-assert" | |||
|
|
|||
| cd "$reponame-assert" | |||
|
|
|||
| git config credential.helper lfstest | |||
|
|
|||
| GIT_TRACE=1 git lfs pull origin master 2>&1 | tee pull.log | |||
| if [ "0" -ne "${PIPESTATUS[0]}" ]; then | |||
| echo >&2 "fatal: expected \`git lfs pull origin master\` to succeed ..." | |||
| exit 1 | |||
| fi | |||
|
|
|||
| assert_local_object "$oid" "${#contents}" | |||
| popd | |||
| ) | |||
| end_test | |||
0 comments on commit
4fe0a8d