Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Emit lifecycle events with timings

Đang mở
#1,555 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, node.js, typescript
Lĩnh vực
devtools, testing

Hướng nghiên cứu

Read the four listed files under packages/testcontainers/src/, then inspect the lifecycle hooks in dependency #1554 to identify the event points. Define observational lifecycle events with timings and add the per-builder form; verify events fire at the hook points without listeners changing or blocking startup. The issue also suggests including a timing summary in the default logs.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement minor

What happens

start() is a black box between the call and the result. The steps (pull, create, copy files, start, port binding, wait strategy, ready) are visible only as debug log lines.

  • A caller cannot show progress, for example "pulling 340 MB".
  • A caller cannot tell where the time went: a 45 second start may be 40 seconds of pull or 40 seconds of waiting.
  • Tooling that wants to report container activity, such as a test reporter, has to parse debug output.

Expected

Structured events for the lifecycle, with timings:

TestContainers.on("container", (event) => {
  // { type: "pulled" | "created" | "started" | "ready" | "stopped" | ..., image, containerId, durationMs }
});

and a per-container form on the builder. Events are observational: a listener cannot change or block the start.

Where

  • packages/testcontainers/src/generic-container/generic-container.ts
  • packages/testcontainers/src/generic-container/started-generic-container.ts
  • packages/testcontainers/src/container-runtime/clients/image/docker-image-client.ts
  • packages/testcontainers/src/docker-compose-environment/docker-compose-environment.ts

Notes

  • The points where events fire are the points where the lifecycle hooks run.
  • A summary of the timings in the default log output would answer most "why is my test slow" questions without code.

Dependencies

  • Stack on #1554: events fire at the same points the hooks run.
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

Mở trong Codespaces

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.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của testcontainers/testcontainers-node

Tất cả issue của testcontainers/testcontainers-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.