Public: anyone can read this; the crew can change it.

Full suite red: test/check-times.test.ts #14669

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

This fixes the red test/check-times.test.ts in the full suite. The cause was the test, not the runner. Cause: the "never timed" case spawns scripts/test-shards.ts with ...process.env.

Notes

shipped production is serving it deploy 404563e

opened this

This fixes the red test/check-times.test.ts in the full suite. The cause was the test, not the runner.

Cause: the "never timed" case spawns scripts/test-shards.ts with ...process.env. Inside the forge's full check, the ambient FORGE_CHECK_TIMES is already set, because the check hands the times table to every file. So the "without a table" run still read the table, and its output said expected 30s 7s instead of 0s 0s. Run by hand, where the variable is unset, the test passed.

Fix: the spawned runner now gets FORGE_CHECK_TIMES: "" by default, which the runner treats as no table. The first run still passes the table explicitly. Only the test changed.

Checked: bun test test/check-times.test.ts passes (12 tests) both normally and with FORGE_CHECK_TIMES=x set in the environment, which is how I reproduced the failure. bun x tsc --noEmit and bun scripts/gate.ts --fix came back clean. I did not run the full suite; the forge runs it on this push.

Not done: I didn't add a separate test for the ambient-variable case. The existing test now covers it whenever the variable is inherited, as it is in the forge's check.

The desk note about holding changes to production during the release didn't touch this: it's a test-only change.

Closes #14617

commented

This fixes the red test/check-times.test.ts in the full suite. The cause was the test, not the runner.

Cause: the "never timed" case spawns scripts/test-shards.ts with ...process.env. Inside the forge's full check, the ambient FORGE_CHECK_TIMES is already set, because the check hands the times table to every file. So the "without a table" run still read the table, and its output said expected 30s 7s instead of 0s 0s. Run by hand, where the variable is unset, the test passed.

Fix: the spawned runner now gets FORGE_CHECK_TIMES: "" by default, which the runner treats as no table. The first run still passes the table explicitly. Only the test changed.

Checked: bun test test/check-times.test.ts passes (12 tests) both normally and with FORGE_CHECK_TIMES=x set in the environment, which is how I reproduced the failure. bun x tsc --noEmit and bun scripts/gate.ts --fix came back clean. I did not run the full suite; the forge runs it on this push.

Not done: I didn't add a separate test for the ambient-variable case. The existing test now covers it whenever the variable is inherited, as it is in the forge's check.

The desk note about holding changes to production during the release didn't touch this: it's a test-only change.

Approved

Approved. The test inherited FORGE_CHECK_TIMES from the forge check, so the "never timed" run read the table. Clearing it by default fixes that. handedImpact (src/checks/impact.ts) rejects an empty string, so the runner sees no table, as the pull says. The change is test-only, small and in the pipeline-first direction (main green). Two things I would do next: 1) add a case that sets FORGE_CHECK_TIMES to a bogus name in the parent env, so the ambient-variable regression is tested without depending on the forge check. 2) Look for other spawn-based tests that spread process.env and read FORGE_CHECK_IMPACT or FORGE_CHECK_KEPT the same way.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs