Skip to content

test(sdkharness): refuse a resilience run on a simulator that already served requests - #624

Merged
sophiecarreras merged 1 commit into
masterfrom
sdkharness/resilience-require-fresh-simulator
Oct 4, 2026
Merged

sophiecarreras merged 1 commit into
masterfrom
sdkharness/resilience-require-fresh-simulator

Conversation

@sophiecarreras

Copy link
Copy Markdown
Contributor

Summary

Local runs of the repository-owned resilience scenarios on ONE shared simulator failed where the harness runner (fresh simulator per scenario) passes: upload.cap_exceeded_403 ("N b2_upload_file calls", fleet run 37096583023 passed it) and api.retry_after_503 ("2 injected 503 ..., expected 1").

Root cause: the leaves read the simulator whole request journal (GET /journal) and count its entries, and the simulator has no journal reset. On a simulator an earlier scenario used, a leaf reads that scenario requests as its own. This is not an SDK defect and the simulator behaves as documented.

The dispatcher now FAILs with a configuration reason when the journal is not empty, so a shared simulator produces an honest setup error, not a false SDK verdict. The harness runner starts a fresh simulator per scenario, so its results are unchanged (15 PASS + upload.stall no-client-option).

Test plan

  • Unit tests for the stale-journal refusal, a fresh journal, and an unreadable journal in test_sdkharness_conformance_resilience_contract.py (98 passed across test_sdkharness*.py).
  • b2-simulator v0.4.1 (d0dd211): all 16 leaves on one simulator before: api.retry_after_503 and upload.cap_exceeded_403 FAIL; after: refused with the configuration reason. Fresh simulator per scenario: 15 PASS + 1 SKIP. Harness bin/run-resilience.sh b2-sdk-python against this commit: 15 PASS + 1 SKIP.
  • Loopback simulator only; no production endpoint contacted.

Touches .sdkharness/tests/lib/contract.py, which #623 also edits; trivial rebase if #623 merges first.

🤖 Generated with Claude Code

… served requests

The resilience leaves count the simulator's whole request journal, which has no
reset. On a simulator shared by several scenarios, upload.cap_exceeded_403 read
earlier scenarios' b2_upload_file entries as its own and failed with N calls, and
api.retry_after_503 counted earlier injected 503s. The dispatcher now FAILs with a
configuration reason when the journal is not empty.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sophiecarreras sophiecarreras self-assigned this Oct 4, 2026
@sophiecarreras
sophiecarreras merged commit fbda229 into master Oct 4, 2026
51 of 53 checks passed
@sophiecarreras
sophiecarreras deleted the sdkharness/resilience-require-fresh-simulator branch October 4, 2026 01:59
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.

1 participant