Skip to content

testserver: optional response headers on fault rules - #7784

Draft
yuanjieding-db wants to merge 1 commit into
yuanjieding-db/fs-cp-skip-parent-checkfrom
yuanjieding-db/testserver-fault-headers
Draft

yuanjieding-db wants to merge 1 commit into
yuanjieding-db/fs-cp-skip-parent-checkfrom
yuanjieding-db/testserver-fault-headers

Conversation

@yuanjieding-db

@yuanjieding-db yuanjieding-db commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Stack. Each PR is based on the one before it, so its diff shows only its own change.

PR
1 #7711 Skip the per-file parent-directory check in fs cp -r
2 #7784 testserver: optional response headers on fault rules
3 #7712 fs cp -r: keep going past failed files (validation results are here)
4 #7785 fs cp -r: stop when files keep failing for 5 minutes
5 #7786 fs cp -r: back off during failure bursts
6 #7787 fs cp -r: retry transient directory errors

This is part 2.

Changes

A testserver fault rule can now carry response headers. fault.py takes them as --header NAME:VALUE, repeated for more headers. Existing rules are unchanged. The fault endpoint now calls set directly to pass the headers, so FaultRules.SetAfterHandler has no callers left and is removed. This is test infrastructure only, so there's no release note.

Why

The breaker's acceptance test in #7786 needs a 500 that carries Retry-After.

Tests

  • TestServerFaultHeaders: the header is on the fault response and not on the next one.
  • The full go test ./acceptance suite, including every test that uses fault.py.

Self-review

Isaac review: no findings.

/code-review (medium), 7 findings:

  • Fixed:
    • --header accepted an empty or missing name. It now exits with --header needs NAME:VALUE.
    • "Repeatable" was ambiguous. The help text now says a repeated name keeps the last value.
    • Headers was exported, unlike its sibling fields. It's unexported now, which also keeps code outside the package from changing the map that copies returned by Check share.
  • Not changed:
    • Names that differ only in case collide, because http.Header canonicalizes them. No test needs that.
    • --body-contains has no bounds check. That's existing code, outside this change.
    • set takes positional arguments. A struct would be a bigger refactor than this one helper needs.

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 3dd75228a | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

1 tests: regression=1 unreleased=0 coverage=0 failing=0
test branch main (4e503ea) latest (v1.26.0)
TestAccept/cmd/fs/cp-r-requests ✅ ❌ ❌
TestAccept/cmd/fs/cp-r-requests: branch ✅ | main (4e503ea) ❌ | latest (v1.26.0) ❌

main (4e503ea):

acceptance_test.go:1380: Diff:
        --- cmd/fs/cp-r-requests/output.txt
        +++ /tmp/TestAcceptcmdfscp-r-requests711305777/002/output.txt
        @@ -7,6 +7,9 @@
         === Recursive copy: a directory PUT per directory, a file PUT per file, no directory HEAD per file
         
         >>> print_requests.py --sort //api/2.0/fs/
        +{"method":"HEAD","path":"/api/2.0/fs/directories/Volumes/main/default/fs-cp-r-requests/dst"}
        +{"method":"HEAD","path":"/api/2.0/fs/directories/Volumes/main/default/fs-cp-r-requests/dst"}
        +{"method":"HEAD","path":"/api/2.0/fs/directories/Volumes/main/default/fs-cp-r-requests/dst/sub"}
         {"method":"PUT","path":"/api/2.0/fs/directories/Volumes/main/default/fs-cp-r-requests/dst"}
         {"method":"PUT","path":"/api/2.0/fs/directories/Volumes/main/default/fs-cp-r-requests/dst/sub"}
         {"method":"PUT","path":"/api/2.0/fs/files/Volumes/main/default/fs-cp-r-requests/dst/a.txt"}
        
FAIL

latest (v1.26.0): same output as main (4e503ea)

A fault rule can now carry headers that are added to its response, so an
acceptance test can return, e.g., Retry-After with an injected 503.
fault.py takes them as --header NAME:VALUE. Existing rules are unchanged.

The fault endpoint now calls set directly to pass the headers, which
leaves FaultRules.SetAfterHandler without callers, so it is removed.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 3dd7522

Run: 44376512920

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 16 10:01
💚​ aws-windows-latest-4core-16gb 1 272 14 8:47
💚​ azure linux-2core-8gb 1 269 16 10:15
💚​ azure-windows-latest-4core-16gb 1 271 14 6:51
💚​ gcp linux-2core-8gb 1 270 16 9:31
🔄​ gcp-windows-latest-4core-16gb 2 1 270 14 6:36
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestSyncFullFileSync ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestSyncNestedFolderSync ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
Top 9 slowest tests (at least 2 minutes):
duration env testname
4:03 azure-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
3:44 gcp linux-2core-8gb TestAccept
3:44 azure linux-2core-8gb TestAccept
3:15 aws linux-2core-8gb TestAccept
2:45 azure-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files
2:34 aws-windows-latest-4core-16gb TestExportWithFileFlag
2:26 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat
2:06 aws-windows-latest-4core-16gb TestExportDir
2:00 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants