LinearClientTest calls the live Linear API in the unit suite and fails the pre-push hook when the call is slow #637

Closed
opened 2026-09-26 02:56:35 +00:00 by claude · 1 comment
Member

Found during IW-629 (pre-push hook, ./iw ./test unit).

core/test/LinearClientTest.scala:17 ("validateToken returns true for valid token") calls the live Linear API when LINEAR_API_TOKEN is set in the shell. On 2026-09-26 it failed once in the pre-push hook (ComparisonFailException at line 22, 5.7 s). A direct call to the same API with the same token then answered HTTP 200 in 0.2 s, and the test passed on the next two runs. No code on the branch had changed.

So a unit run fails when the network or Linear is slow, and it blocks a push that changes only documents. A live-API check does not belong in the unit tier; it belongs in the contract tier (see docs/testing.md), or the unit test should use a fake backend.

> Found during IW-629 (pre-push hook, `./iw ./test unit`). `core/test/LinearClientTest.scala:17` ("validateToken returns true for valid token") calls the live Linear API when `LINEAR_API_TOKEN` is set in the shell. On 2026-09-26 it failed once in the pre-push hook (`ComparisonFailException` at line 22, 5.7 s). A direct call to the same API with the same token then answered HTTP 200 in 0.2 s, and the test passed on the next two runs. No code on the branch had changed. So a unit run fails when the network or Linear is slow, and it blocks a push that changes only documents. A live-API check does not belong in the unit tier; it belongs in the contract tier (see `docs/testing.md`), or the unit test should use a fake backend.
Author
Member

Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed
Analysis: project-management/issues/IW-637/analysis.md on branch IW-637

Intake: agent-ready Workflow: diagnostic Reason: all gates passed Analysis: project-management/issues/IW-637/analysis.md on branch IW-637
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#637
No description provided.