Test deadline behavior without context identity

This commit is contained in:
2026-09-26 16:17:23 +00:00
parent 6508ccc036
commit b399ebe391
2 changed files with 34 additions and 15 deletions

View File

@@ -3,18 +3,18 @@
## Scope And Status
Review baseline: `e177d7c`, covering implementation commits after `5c3b0cf`.
This document records an outstanding test-contract issue; it does not authorize
This document records a resolved test-contract issue; it does not authorize
unrelated implementation changes. No runtime defect or missing planned feature
was identified in this review. Release preparation remains separate work.
## R1: Remove The Unrequested Context-Identity Invariant
Priority: P3 (low). Status: Open.
Priority: P3 (low). Status: Complete.
Location: `internal/adapter/http/handler_test.go:334–349`,
Original location: `internal/adapter/http/handler_test.go:334–349`,
`TestHandlerRunTimeoutValidationAndContextMapping`, introduced in `7de2b02`.
The test's `child` field and `(ctx != parent) != tc.child` assertion require
The test's `child` field and `(ctx != parent) != tc.child` assertion required
the exact parent context object for omitted/null/zero timeouts and a distinct
object for a positive timeout. The requested contract concerns effective
deadlines and cancellation propagation, not Go interface identity. In
@@ -22,7 +22,7 @@ particular, a harmless derived context that preserves the parent's deadline,
values, and cancellation would fail the omission cases despite satisfying the
application contract.
This elevates an incidental implementation choice into a test-enforced
This elevated an incidental implementation choice into a test-enforced
invariant, contrary to the [agent policy](../policy/agents.md) and
[testing policy](../policy/testing.md). The current handler's context behavior
is correct; this is a maintainability issue, not a runtime cancellation bug.
@@ -48,7 +48,19 @@ refactor solely to change this test.
is a different object.
- Existing timeout validation and HTTP outcome coverage remains intact.
## Review Verification
### Resolution And Validation
Removed the identity-only table field and context comparisons. The test now
checks effective deadlines, including omitted/null/zero requests with no
parent deadline, and explicitly checks that parent cancellation reaches the
runner. Existing positive-deadline integration tests and live-context
provider-timeout mapping remain intact. No production code changed.
Focused HTTP timeout tests, `go test ./...`, `go test -race ./...`,
`go vet ./...`, a native build outside the repository, and `git diff --check`
all passed after remediation.
## Original Review Verification
- `go test -race -count=1 ./...` passed, including retry, shared-capacity,
deadline, report, definition-conformance, and architecture-boundary tests.