test(uploads): pin the idle bound an unset App resolves to (#56)
Round-2 gatekeeper finding: production never sets UploadIdleTimeout, so it
always runs the zero-means-default branch, and nothing asserted what that
branch resolved to (`idle = time.Hour` kept the suite green).
Extract the resolution into App.uploadIdleTimeout(), expose it via
export_test.go, and assert (&web.App{}) resolves to exactly 60s, a
negative value too, and a set value is honoured. Verified red against the
time.Hour mutant before implementing.
Rename the socket test to what it observes:
...AnUnsetIdleTimeoutDoesNotCutABodyWithSubSecondGaps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
package web
|
||||
|
||||
import "time"
|
||||
|
||||
// DefaultUploadIdleTimeout exposes the production idle bound (#56) to the black-box tests:
|
||||
// cmd/tapir never sets App.UploadIdleTimeout, so this constant IS the deployed value.
|
||||
const DefaultUploadIdleTimeout = defaultUploadIdleTimeout
|
||||
|
||||
// UploadIdleTimeoutForTest exposes the bound an App resolves to (#56), so a test can pin the
|
||||
// value the zero-value App -- production's -- actually uses rather than only the constant.
|
||||
func (a *App) UploadIdleTimeoutForTest() time.Duration { return a.uploadIdleTimeout() }
|
||||
|
||||
Reference in New Issue
Block a user