Skip to content

test(sdkharness): upload.stall runs through the CLI's CI request-timeout hook - #1186

Open
sophiecarreras wants to merge 1 commit into
masterfrom
sdkharness/upload-stall-runnable
Open

sophiecarreras wants to merge 1 commit into
masterfrom
sdkharness/upload-stall-runnable

Conversation

@sophiecarreras

Copy link
Copy Markdown
Contributor

What

The sdkharness upload.stall check (.sdkharness/tests/resilience-upload.py) used to report SKIP no-client-option because it hard-coded that the CLI has no per-request timeout shorter than the 60 s controlled stall. It now runs. For that scenario only, the CLI subprocess gets CI=1 and GITHUB_REPOSITORY=Backblaze/B2_Command_Line_Tool, then the existing wire-fault path asserts from the simulator journal that exactly one stall fired, that a later b2_upload_file returned 200 on a different uploadUrlId, and that the file reads back intact.

Why this is possible

b2/_internal/_cli/b2api.py already shortens the b2sdk request timeouts when CI is set and GITHUB_REPOSITORY ends with /B2_Command_Line_Tool (TIMEOUT_FOR_UPLOAD = 24, TRY_COUNT_DATA = 2, among others), which is the setting the CLI's own CI relies on. With it, a 60 s stalled upload is abandoned after 24 s and retried on a new upload URL. The product code is unchanged; only .sdkharness/ and a changelog fragment change. The other scenarios keep the stripped environment they had.

Checked

Against the standalone simulator only (no real B2, fake credentials): bin/run-resilience.sh --scenario upload.stall B2_Command_Line_Tool from the sdkharness, pointed at a checkout of this branch: PASS, about 25 s (the runner only accepts a PASS when the journal shows the stall fired). Journal of that run:

seq 3  b2_get_upload_url  200               uploadUrlId ...0003
seq 4  b2_upload_file     fault=stall       uploadUrlId ...0003   (abandoned)
seq 5  b2_get_upload_url  200               uploadUrlId ...0004
seq 6  b2_upload_file     200               uploadUrlId ...0004   (recovered)

Tracks backblaze-labs/demand-side-ai#1354 (same case as the Python one, Backblaze/b2-sdk-python#628).

🤖 Generated with Claude Code

…out hook

The check hard-coded Skip('no-client-option') because the CLI has no timeout option.
b2/_internal/_cli/b2api.py shortens the b2sdk timeouts (TIMEOUT_FOR_UPLOAD=24, TRY_COUNT_DATA=2)
when CI is set and GITHUB_REPOSITORY ends with /B2_Command_Line_Tool. The stall scenario now
sets both in the CLI subprocess environment only; the product code is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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