npm test fails on main because publication subtests share leaked state

Đang mở
#56 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

@NopeCharon đang làm issue này rồi.

Từ ngày 19/11/2026.

  • #57 của @NopeCharon — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
git, github-actions, node.js, typescript
Lĩnh vực
ci-cd, testing

Hướng nghiên cứu

Start with the failing subtests in scripts/publication.test.ts and inspect how the store, counters, and PR labels are reset between them. Run npm test to reproduce the four failures, then verify cleanup prevents one subtest from affecting the next. The issue also proposes a read-only workflow for pull requests and pushes to main; done means npm test passes and the workflow runs it on both events.

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

Mô tả

npm test fails on main, and has since #34. 4 of the 30 tests fail (Node 24.22):

✖ label changes prevent archival and promotion
✖ merge with no archive reports failure and requires manual archival
✖ promotion failure after merge still retains the valid archive remotely
✖ CI archival and promotion with simulated GitHub and Git

The publication code is fine. This is shared state leaking between subtests of CI archival and promotion with simulated GitHub and Git in scripts/publication.test.ts:

  1. #34 added incomplete artifacts and untrusted runner SKUs cannot archive. It ends with downloads === 2 and doesn't reset the counters. Before that change, the preceding test ended with clearStore().
  2. label changes prevent archival and promotion doesn't call clearStore(), so assert.equal(downloads, 0) sees 2 and throws.
  3. The throw skips the pr.labels = [] on the last line, so the PR keeps the benchmarks: skip label. The next two tests then take the approved-skip path instead of the failure they expect, and fail with "Missing expected rejection".

Bisecting confirms it. 02d7c6f passes 29/29, and bdbca55 (#34) is the first commit that fails.

No workflow runs npm test, so CI didn't catch it. #34 notes "Tests were not run."

Proposed fix:

  • Reset the store and counters at the start of the label test, and restore the mutated fixtures in finally blocks so one failing subtest can't cascade into later ones.
  • Add a read-only workflow that runs npm test on PRs and pushes to main.
Ngôn ngữ chính
TypeScript
Star
2
Fork
1
Merge trung bình
6 giờ 19 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 hyperlight-dev/hyperlight-bench

Tất cả issue của hyperlight-dev/hyperlight-bench

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.