-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1269 from dabooz/issue1266
Issue 1266 - large model object upload times out
- Loading branch information
Showing
4 changed files
with
95 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,49 @@ then | |
exit -1 | ||
fi | ||
|
||
#Test timeout support for upload of large files to the CSS | ||
dd if=/dev/zero of=/tmp/data.txt count=512 bs=1048576 | ||
|
||
[email protected] | ||
RESOURCE_TYPE=test | ||
|
||
export HZN_FSS_CSSURL=${CSS_URL} | ||
|
||
read -d '' resmeta <<EOF | ||
{ | ||
"objectID": "test1", | ||
"objectType": "test", | ||
"destinationType": "test", | ||
"version": "1.0.0", | ||
"description": "a file" | ||
} | ||
EOF | ||
|
||
echo "$resmeta" > /tmp/meta.json | ||
|
||
hzn mms object publish -m /tmp/meta.json -f /tmp/data.txt | ||
RC=$? | ||
if [ $RC -ne 0 ] | ||
then | ||
echo -e "Got unexpected error uploading 512MB model object: $RC" | ||
exit -1 | ||
fi | ||
|
||
# Now, shorten the HTTP request timeout so that the upload fails. Internally, the CLI will retry | ||
# before giving up with the appropriate HTTP Client timeout error. | ||
export HZN_HTTP_TIMEOUT="2" | ||
|
||
hzn mms object publish -m /tmp/meta.json -f /tmp/data.txt | ||
RC=$? | ||
if [ $RC -eq 5 ] | ||
then | ||
echo -e "Got expected error with 521MB object upload using short HTTP request timeout: $RC" | ||
else | ||
echo -e "Got unexpected error with 521MB object upload using short HTTP request timeout: $RC" | ||
exit -1 | ||
fi | ||
|
||
# Reset the HTTP timeout env var to the default for the CLI. | ||
unset HZN_HTTP_TIMEOUT | ||
|
||
echo "Testing model management APIs successful" |