Support `AbortSignal` in `start()`, `exec` and other long-running calls
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker, node.js, typescript
Hướng nghiên cứu
Start by reading start and startContainer in packages/testcontainers/src/generic-container/generic-container.ts, then trace image pull and build, wait strategies, exec, and Compose up in the listed files. Check the coordination requirements for #1558, #1548, and #1582 before changing shared interfaces. Done means long-running calls accept an AbortSignal, reject with its reason on abort, and clean up partially created resources.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Nothing in the API accepts an AbortSignal.
start()can spend minutes pulling an image and waiting for readiness. When the test runner times the test out, or the user gives up, the start carries on in the background. The container is still created and stays until Ryuk removes it at process exit.- The only timeout is the wait strategy's startup timeout. It does not cover the image pull.
exechas no timeout and cannot be cancelled, so a command that hangs blocks its caller indefinitely.DockerComposeEnvironment.up()andGenericContainerBuilder.build()are the same.
Expected
Long-running operations take a signal:
await new GenericContainer(image).start({ signal: AbortSignal.timeout(30_000) });
await container.exec(["pg_dump"], { signal });
On abort the promise rejects with the signal's reason, and whatever was half-created (container, network attachment, Compose project) is stopped and removed.
Where
startandstartContainerinpackages/testcontainers/src/generic-container/generic-container.tspullandbuildinpackages/testcontainers/src/container-runtime/clients/image/docker-image-client.tspackages/testcontainers/src/wait-strategies/*.tsexecinpackages/testcontainers/src/container-runtime/clients/container/docker-container-client.tsupinpackages/testcontainers/src/docker-compose-environment/docker-compose-environment.ts
Notes
- Go passes a
context.Contextto every call. .NET takes aCancellationToken. - Related: #1081 asked for this. It was closed when the reporter's underlying problem turned out to be something else.
- A startup deadline is a signal with a timeout. One mechanism can serve both this and #1582.
Dependencies
- Stack on #1558: both change the wait strategy interface. Change it once, in the same major.
- Coordinate with #1548:
execgains a timeout there. Make the two agree. - Coordinate with #1582: the deadline can be carried by the same signal.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.6k
- Fork
- 274
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 44
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của testcontainers/testcontainers-node
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
testcontainers/testcontainers-node#1539 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
testcontainers/testcontainers-node#1533 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
testcontainers/testcontainers-node#1531 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
testcontainers/testcontainers-node#1529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
testcontainers/testcontainers-node#1528 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của testcontainers/testcontainers-node
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dsh-market/dsh-market#877 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
stellar/stellar-dev-skill#151 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Trial & Error: guided Blind offer squeezes on phones and sits under the touch toolbar on iPadĐang mởarea:arcade game ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
fderuiter/deruiter.dev#2281 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
scope: data grid type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày