Skip to content

test: remove expected-durations.test.ts - #36781

Merged
Jarred-Sumner merged 1 commit into
mainfrom
claude/expected-durations-test
Aug 2, 2026
Merged

Jarred-Sumner merged 1 commit into
mainfrom
claude/expected-durations-test

Conversation

@Jarred-Sumner

Copy link
Copy Markdown
Collaborator

What does this PR do?

Deletes test/internal/expected-durations.test.ts, which started failing on main after a00c4db regenerated test/expected-durations.json.

Failing assertion no js/{node,bun}/test/parallel/* entry > 500 ms
Why it assumed that scripts/update-test-durations.mjs clamps concurrent-phase inter-dispatch gaps to 500 ms
Why it's wrong explicit (N.Ns) timed headers bypass the clamp by design, so a genuinely slow parallel test is recorded at real wall-clock — test-fs-read-stream-pos.js is 74 s on musl / 90 s on windows in the new table, which is what the shard bin-packer should see
Rest of the file shape checks on a file only ever written by the generator script; trips on regens without catching anything the generator wouldn't

How did you verify your code works?

bun test test/internal/expected-durations.test.ts on main reproduces the failure (+ "js/node/test/parallel/test-fs-read-stream-pos.js"); nothing else references the file.

It asserted no js/*/test/parallel/ entry in test/expected-durations.json
exceeds 500 ms, assuming the generator clamps every concurrent-phase span.
The generator only clamps inter-dispatch gaps; explicit `(N.Ns)` timed
headers are recorded as-is, so a genuinely slow parallel test (e.g.
test-fs-read-stream-pos.js at 74 s on musl) fails the test after any
regeneration. The remaining assertions only re-validated the shape of a
file that is produced by scripts/update-test-durations.mjs.

No-Verification-Needed: deletes a test file only
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 18cab859-5f65-4c69-bdbf-b25bafcc7fcc

📥 Commits

Reviewing files that changed from the base of the PR and between a00c4db and 6096f97.

📒 Files selected for processing (1)
  • test/internal/expected-durations.test.ts
💤 Files with no reviewable changes (1)
  • test/internal/expected-durations.test.ts

Walkthrough

The pull request deletes the expected duration validation test and removes its checks for lane metadata, test-path keys, parallel-phase coverage, span clamping, lane durations, and minimum table size.

Changes

Cohort / File(s) Summary
Expected duration validation
test/internal/expected-durations.test.ts
Deletes validation coverage for expected duration data.

Possibly related PRs

  • oven-sh/bun#33622: Deletes validation tests for test/expected-durations.json and changes related duration data handling.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states that the failing expected-durations test file is removed.
Description check ✅ Passed The description includes both required sections and explains the reason for the deletion and how the failure was reproduced.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@Jarred-Sumner
Jarred-Sumner merged commit fdbaf06 into main Aug 2, 2026
8 of 35 checks passed
@Jarred-Sumner
Jarred-Sumner deleted the claude/expected-durations-test branch August 2, 2026 13:34

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean removal of an internal test whose core assertion no longer matches the generator's contract.

What was reviewed:

  • Confirmed the 500 ms clamp assertion conflicts with update-test-durations.mjs recording explicit (N.Ns) headers at real wall-clock (by design, so the bin-packer sees true cost).
  • Verified nothing else references this test file; the only grep hit is its own stale entry in expected-durations.json.
  • Remaining deleted assertions were shape checks on a machine-generated file — no coverage lost for hand-authored code.
Extended reasoning...

Overview

This PR deletes a single file, test/internal/expected-durations.test.ts (65 lines). The file was a guard test over test/expected-durations.json, a checked-in table produced entirely by scripts/update-test-durations.mjs and consumed by the CI shard bin-packer. It began failing on main after commit a00c4db regenerated the table, because it asserted no js/{node,bun}/test/parallel/* entry exceeds 500 ms — an assumption that only held for clamped inter-dispatch gaps, not for entries derived from explicit (N.Ns) timed headers, which the generator intentionally records at real wall-clock so slow tests weigh correctly in shard packing.

Security risks

None. This touches only an internal test file over CI tooling metadata. No runtime, native, or user-facing code is affected.

Level of scrutiny

Low. This is a test-only deletion with a clearly stated and verifiable rationale. The repo's own review guidance says every deletion needs a stated reason — the PR description provides a precise one (the assertion encoded a wrong assumption about the generator, and the rest of the file re-validated shape invariants the generator itself enforces). Per the same guidance, tests that trip on regens without catching real defects are noise; "do not add tests to check dead code stays dead" applies in spirit here.

Other factors

I confirmed via grep that no other file imports or references expected-durations.test.ts; the sole hit is the durations table listing this test's own runtime, which will drop out on the next regeneration. The commit message and PR description independently explain the mechanism (clamp vs. timed headers), and the failing case (test-fs-read-stream-pos.js at 74 s musl / 90 s windows) is exactly the kind of real signal the bin-packer needs — so "fixing" the test to accommodate it would defeat its only non-trivial assertion. Deletion is the right call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant