Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support `AbortSignal` in `start()`, `exec` and other long-running calls

オープン
#1,560 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker, node.js, typescript
領域
backend, testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

enhancement minor

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.
  • exec has no timeout and cannot be cancelled, so a command that hangs blocks its caller indefinitely.
  • DockerComposeEnvironment.up() and GenericContainerBuilder.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

  • start and startContainer in packages/testcontainers/src/generic-container/generic-container.ts
  • pull and build in packages/testcontainers/src/container-runtime/clients/image/docker-image-client.ts
  • packages/testcontainers/src/wait-strategies/*.ts
  • exec in packages/testcontainers/src/container-runtime/clients/container/docker-container-client.ts
  • up in packages/testcontainers/src/docker-compose-environment/docker-compose-environment.ts

Notes

  • Go passes a context.Context to every call. .NET takes a CancellationToken.
  • 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: exec gains a timeout there. Make the two agree.
  • Coordinate with #1582: the deadline can be carried by the same signal.
主要言語
TypeScript
スター
2.6k
フォーク
274
平均マージ
1日 14時間
マージ済み PR(30日)
44

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

testcontainers/testcontainers-node のほかの issue

testcontainers/testcontainers-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。