Inventory smoke tests can hang despite command timeout; fail with bounded diagnostics
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Problem
assert_inventory_tools_run can leave an integration-test job waiting until its job-level timeout instead of producing a failed Bats test when a command hangs.
The helper already runs each command with:
run timeout --kill-after=5s 30s "${tool}" "${args[@]}" < /dev/null
However, this does not bound the observed end-to-end execution of the Bats test in the reproduction below. Increasing the workflow timeout is not the desired fix: a stalled smoke command should fail promptly with an actionable diagnostic.
Observed reproduction
Observed using the bats-tool-inventory helper shipped in the v9.1.0 image (same implementation in actions/v2.3.2), with NuGet 2.8.7 and the JUnit formatter:
{
"packages": {
"nuget": {
"commands": ["nuget"],
"smoke-test-args": {"nuget": ["help"]}
}
}
}
#!/usr/bin/env bats
setup() {
bats_load_library bats-support
bats_load_library bats-assert
bats_load_library bats-tool-inventory
}
@test "inventory commands start successfully" {
assert_inventory_tools_run "${BATS_TEST_DIRNAME}/inventory.json"
}
Run the test without an interactive terminal:
bats --formatter junit smoke.bats
Observed behavior:
nuget helphangs when stdin is/dev/nulland output is redirected/captured. It finishes when run through a pseudo-terminal.- A direct outer
timeoutcan stop the NuGet invocation, but the Bats inventory test did not return after the helper's nominal 30-second timeout plus five-second kill grace. - A local reproduction needed an outer 90-second timeout to stop Bats. The JUnit output had no completed test case.
- Integration jobs on both amd64 and arm64 remained in the test step for approximately 20 minutes, until the job timeout. No actionable failed-test report was available.
- Changing the NuGet smoke invocation to
nuget config -NonInteractivemade the inventory smoke test finish in approximately six seconds locally. This is a caller-side workaround, not a general timeout fix.
The exact mechanism remains unconfirmed. Please investigate process-tree cleanup, inherited file descriptors/output capture, and whether excessive output can prevent Bats from completing after the command timeout. These are hypotheses, not established causes.
Expected behavior
A hung command should result in a bounded, ordinary failed test, not a workflow cancellation:
- Report the package, escaped command/arguments, timeout duration and exit status, explicitly identifying a timeout.
- Include useful bounded output without allowing excessive output to exhaust memory or stall failure reporting.
- Terminate and reap the command and its descendants; do not leave captured streams or inherited descriptors preventing test completion.
- Emit a complete JUnit failure and allow the workflow to upload the report before its job timeout.
- Keep successful smoke tests and custom
smoke-test-argsbehavior unchanged.
Suggested acceptance coverage
Exercise the real Bats runner and JUnit formatter, not only a stub that makes timeout return 124:
- A command that blocks indefinitely.
- A command that ignores TERM and requires forced termination.
- A command that spawns a child retaining stdout/stderr (and any relevant Bats descriptors).
- A command that produces excessive output while hanging.
- A normal successful command and a nonzero command exit, preserving their existing diagnostics.
Use short test deadlines and assert bounded completion, no surviving child processes, and a complete failed JUnit test case naming the offending command. Consider a suite/test-level safeguard as well as the per-command timeout, but ensure it cannot itself leave a watchdog process or inherited descriptor keeping Bats alive.
Relevant implementation
assert_inventory_tools_runwc-integration-test-docker.yml- Existing helper timeout coverage stubs
timeoutto return 124; it does not exercise actual process termination or Bats output capture.
- Ngôn ngữ chính
- Shell
- Star
- 136
- Fork
- 8
- Merge trung bình
- 17 giờ 19 phút
- Pull request đã merge (30 ngày)
- 53
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.
- Không có Dockerfile hay tệp Docker Compose
- 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 philips-software/amp-devcontainer
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
philips-software/amp-devcontainer#1571 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Evaluate tool versionsĐang mởscheduled stale tool-versions
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
philips-software/amp-devcontainer#1475 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
philips-software/amp-devcontainer#1433 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Evaluate tool versionsĐang mởscheduled tool-versions
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
philips-software/amp-devcontainer#1222 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
philips-software/amp-devcontainer#1136 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của philips-software/amp-devcontainer
Issue tương tự
-
documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aws/aws-networking-best-practices#256 ·
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 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
ChatGPT directory is behind mainĐang mởopenai-directory
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
smores56/homelab-platform#289 ·
Maintainer thường phản hồi trong vòng 1 ngày