Skip to content

feat: add AfterOffset for testing stall control - #1684

Merged
parthea merged 1 commit into
mainfrom
resumable-upload-stall-control
Sep 14, 2026
Merged

parthea merged 1 commit into
mainfrom
resumable-upload-stall-control

Conversation

@bshaffer

Copy link
Copy Markdown
Contributor

Adds after_offset config to chunk upload in order to test stall control.

See https://github.com/googleapis/google-cloud-php/blob/3cda3dc6ac4af05d508794c4a8eaabd3bd9e3068/Gax/tests/Conformance/ResumableUploadTest.php#L212-L232 for an example:

        $chunkSize = 256 * 1024;
        $payload = str_repeat('c', $chunkSize * 2);
        $headers = [
            'X-Goog-Test-Scenario-Config' => json_encode([
                'delay_ms' => 1500,
                'after_offset' => $chunkSize,
            ])
        ];
        $resumableUploadOptions = [
            'chunkSize' => $chunkSize,
            'transferStallMinimumRate' => 10,
            'transferStallTimeout' => 1,
        ];

        $this->expectException(ApiException::class);
        $this->expectExceptionMessage('Upload stalled.');

        $this->createClientAndUpload($payload, null, $headers, $resumableUploadOptions);

@bshaffer
bshaffer requested review from a team as code owners September 11, 2026 22:06

@viacheslav-rostovtsev viacheslav-rostovtsev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@parthea
parthea merged commit 9ae8dbd into main Sep 14, 2026
17 checks passed
@parthea
parthea deleted the resumable-upload-stall-control branch September 14, 2026 18:52
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.

3 participants