Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion acceptance/bundle/sync/upload-504/output.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Action: PUT: databricks.yml
Warn: retrying after 504 Gateway Timeout from POST /api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/databricks.yml
Uploaded databricks.yml
Initial Sync Complete
Warn: retrying after 504 Gateway Timeout from POST /api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/databricks.yml
/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/databricks.yml
/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/databricks.yml
8 changes: 7 additions & 1 deletion acceptance/bundle/sync/upload-504/script
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Inject a single 504 on the first file upload. Uploads overwrite, so they are retried and the sync succeeds.
fault.py "POST /api/2.0/workspace-files/import-file/**" 504 0 1

$CLI bundle sync
# Progress goes to stdout from a separate goroutine while the retry warning is logged to stderr,
# so their interleaving is nondeterministic. Print stderr after stdout to keep the order stable.
# The file lives outside the synced directory so that it is not uploaded.
errfile=$(mktemp)
$CLI bundle sync 2> "$errfile"
cat "$errfile"
rm "$errfile"

# databricks.yml is the only file. Two requests for it should appear: the initial 504 and the successful retry.
print_requests.py //api/2.0/workspace-files/import-file | jq -r .path
2 changes: 1 addition & 1 deletion acceptance/cmd/sync/upload-504/output.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Action: PUT: hello.py
Warn: retrying after 504 Gateway Timeout from POST /api/2.0/workspace-files/import-file/Users/[USERNAME]/sync-504-[UNIQUE_NAME]/hello.py
Uploaded hello.py
Initial Sync Complete
Warn: retrying after 504 Gateway Timeout from POST /api/2.0/workspace-files/import-file/Users/[USERNAME]/sync-504-[UNIQUE_NAME]/hello.py
/api/2.0/workspace-files/import-file/Users/[USERNAME]/sync-504-[UNIQUE_NAME]/hello.py
/api/2.0/workspace-files/import-file/Users/[USERNAME]/sync-504-[UNIQUE_NAME]/hello.py
9 changes: 7 additions & 2 deletions acceptance/cmd/sync/upload-504/script
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ remote_dir="/Users/$CURRENT_USER_NAME/sync-504-$UNIQUE_NAME"

cleanup() {
MSYS_NO_PATHCONV=1 $CLI workspace delete --recursive "$remote_dir" 2>/dev/null || true
rm -rf .git .gitignore .databricks "$OUT_REQUESTS"
rm -rf .git .gitignore .databricks "$OUT_REQUESTS" "$errfile"
}
trap cleanup EXIT

# Inject a single 504 on the first file upload. Uploads overwrite, so they are retried and the sync succeeds.
fault.py "POST /api/2.0/workspace-files/import-file/**" 504 0 1

# MSYS_NO_PATHCONV=1 prevents Git Bash on Windows from converting /Users/... to C:/Program Files/Git/Users/...
MSYS_NO_PATHCONV=1 $CLI sync . "$remote_dir"
# Progress goes to stdout from a separate goroutine while the retry warning is logged to stderr,
# so their interleaving is nondeterministic. Print stderr after stdout to keep the order stable.
# The file lives outside the synced directory so that it is not uploaded.
errfile=$(mktemp)
MSYS_NO_PATHCONV=1 $CLI sync . "$remote_dir" 2> "$errfile"
cat "$errfile"

# Two requests for hello.py should appear: the initial 504 and the successful retry.
print_requests.py //api/2.0/workspace-files/import-file | jq -r .path
Loading