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

Regression test report ✅

Commit: 320173591 | Workflow run

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

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

main (f504773):

acceptance_test.go:1402: Diff:
        --- cmd/fs/cp-r-requests/output.txt
        +++ /tmp/TestAcceptcmdfscp-r-requests3767982254/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.28.0): same output as main (f504773)

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 3201735

Run: 46412925351

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 172 11 2:19
💚​ aws-windows-latest-4core-16gb 1 172 11 3:04
💚​ azure linux-2core-8gb 1 171 11 2:29
💚​ azure-windows-latest-4core-16gb 1 171 11 3:22
💚​ gcp linux-2core-8gb 1 172 11 2:35
💚​ gcp-windows-latest-4core-16gb 1 172 11 3:30
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
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:28 gcp-windows-latest-4core-16gb TestAccept
3:20 azure-windows-latest-4core-16gb TestAccept
3:02 aws-windows-latest-4core-16gb TestAccept

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>
@yuanjieding-db
yuanjieding-db force-pushed the yuanjieding-db/fs-cp-skip-parent-check branch from 31b84c4 to cad9885 Compare November 30, 2026 11:48
@yuanjieding-db
yuanjieding-db force-pushed the yuanjieding-db/testserver-fault-headers branch from 3dd7522 to 3201735 Compare November 30, 2026 11:48

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