Skip to content

Add sixteen sdkharness resilience checks: retry, backoff, reauthorization - #221

Merged
sophiecarreras merged 2 commits into
masterfrom
sdkharness/resilience-slice-1
Oct 14, 2026
Merged

sophiecarreras merged 2 commits into
masterfrom
sdkharness/resilience-slice-1

Conversation

@sophiecarreras

Copy link
Copy Markdown
Contributor

Draft: this branches off master, not off #220, and both change .sdkharness/tests.tsv and .sdkharness/README.md. I will rebase it once #220 merges, so please review #220 first.

Adds the resilience level to the .sdkharness/ contract: one scenario per run, named by SDKHARNESS_SCENARIO, run by tests/run-resilience. Each check is a Java program that arms one documented fault through the simulator's control listener, makes one SDK call with the SDK's default retry policy, and asserts the end state and the recovery path from the simulator's request journal.

  • 16 checks: upload retry after 503/500/408/401, reset and stall; no retry after a 403 cap_exceeded; part and download retry; reauthorization after a 401 and after the token's 24 h life; Retry-After and backoff lower bounds.
  • upload.stall sets a 2 s socket timeout through HttpClientFactoryImpl.Builder.setSocketTimeoutSeconds.
  • A check still running after 60 s is killed and reported as a failure.
  • No change to the library or the build.

Results against the pinned simulator: 16 of 16 pass on a JDK 17 launcher and on a JDK 11 launcher (javac --release 11), three runs each, no flakiness.

🤖 Generated with Claude Code

@sophiecarreras
sophiecarreras force-pushed the sdkharness/resilience-slice-1 branch from 4e45f33 to 11d6780 Compare October 14, 2026 16:49
@sophiecarreras
sophiecarreras changed the base branch from master to sdkharness/conformance-slice-1 October 14, 2026 16:49
Base automatically changed from sdkharness/conformance-slice-1 to master October 14, 2026 17:53
sophiecarreras and others added 2 commits October 14, 2026 14:54
…tion

Adds the resilience level to the .sdkharness/ contract: one scenario per run,
named by SDKHARNESS_SCENARIO, run by tests/run-resilience. Each check is a Java
program that arms one documented fault through the simulator's control
listener, makes one SDK call with the SDK's own default retry policy, and
asserts the end state (bytes read back, listing, or the error) and the
recovery path from the simulator's request journal: a fresh upload URL after a
503, 500, 408, 401, reset or stall, no retry after a 403 cap_exceeded,
reauthorization after a 401 and after the token's 24 h life, and the lower
bound of a Retry-After or the first backoff step.

The stall check sets a 2 s socket timeout through the documented
HttpClientFactoryImpl.Builder.setSocketTimeoutSeconds. A check still running
after 60 s is killed and reported as a failure. The harness builds the core and
httpclient jars and passes them as SDKHARNESS_JAVA_CLASSPATH; the build is
unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…p errors, enforce loopback at request time, anchor the verdict match

- A bucket or file the check could not delete, or faults it could not clear, now fails the verdict; every step is still attempted and the single result line is still printed.
- Every check builds its client from one guarded HTTP client factory (the SDK's request settings, including the per-check socket timeout) that refuses any request whose target host is not 127.0.0.1 and fails the verdict if one was attempted. The control-listener requests are held to the same host. GuardSelfTest proves it.
- run-resilience matches the result line at column 1 with index(), not anywhere in a line.
- README: say what is guaranteed (formatting and capping, not redaction).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sophiecarreras
sophiecarreras force-pushed the sdkharness/resilience-slice-1 branch from 11d6780 to 555a8eb Compare October 14, 2026 17:59
@sophiecarreras
sophiecarreras marked this pull request as ready for review October 14, 2026 18:00
@sophiecarreras
sophiecarreras merged commit 581395f into master Oct 14, 2026
4 of 5 checks passed
@sophiecarreras
sophiecarreras deleted the sdkharness/resilience-slice-1 branch October 14, 2026 19:26
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