镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Test: add a timeout test for downloading chunks from the stream - #2133

Merged
danwkennedy merged 2 commits into
mainfrom
danwkennedy/test-blob-stream-timeout
Sep 25, 2025
Merged

danwkennedy merged 2 commits into
mainfrom
danwkennedy/test-blob-stream-timeout

Conversation

@danwkennedy

Copy link
Copy Markdown
Contributor

Description

This test will fail until we merge the changes in this PR. I wanted to take the proposed changes there so I'm adding a test to be merged after the fact.

This should check that a hung stream will fail. I updated the code to make the timeout configurable so we're not waiting the full 30s.

@danwkennedy
danwkennedy requested a review from a team as a code owner September 24, 2025 18:10
Copilot AI review requested due to automatic review settings September 24, 2025 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a timeout test for the streamExtractExternal function to verify that hung streams fail appropriately. The test verifies the timeout functionality by creating a mock HTTP response that never completes and ensuring the function throws a timeout error.

  • Makes the timeout configurable in streamExtractExternal function by adding an optional opts parameter
  • Adds a test case that simulates a hung HTTP stream and verifies timeout behavior with a 2ms timeout

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/artifact/src/internal/download/download-artifact.ts Adds configurable timeout parameter to streamExtractExternal function
packages/artifact/tests/download-artifact.test.ts Adds test case and mock for hung stream timeout scenario

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread packages/artifact/__tests__/download-artifact.test.ts
@danwkennedy
danwkennedy force-pushed the danwkennedy/test-blob-stream-timeout branch from 8e0225f to d26e942 Compare September 25, 2025 13:12
yacaovsnc
yacaovsnc previously approved these changes Sep 25, 2025
@danwkennedy
danwkennedy merged commit ddc5fa4 into main Sep 25, 2025
22 of 23 checks passed
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