Repository navigation
Stop end-to-end runs from losing SpiceDB partway through - #88
Conversation
…can run The fixture stopped its container 1200s after creating it, as a backstop for a killed test process. The bronzethread package now runs longer than that on a busy runner, so the container was stopped under it and the bundles that ran last failed with connection refused. The lifetime now follows the test binary's own -test.timeout, plus a margin, so the binary's deadline is always the first to fire. The e2e package timeout goes from 25m to 40m, since the same package was a minute short of it, and test:bronze takes the same value instead of 10m.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…allback TestTestBinaryTimeout_ReadsTheRunsOwnTimeout asserted only that the value was positive, so a testBinaryTimeout returning a hardcoded duration still passed. It now checks that the timeout read, minus the time left until t.Deadline, equals how long the binary has been running (within 5s), which a constant misses by however far it is off. testBinaryTimeout also returned 0 without a word when the test.timeout flag existed but did not read as a time.Duration, silently moving every container to the 2h untimed lifetime. Both of those paths now write a line to stderr, as the rest of the fixture does; an absent flag stays silent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
samkim
left a comment
There was a problem hiding this comment.
This PR replaces the SpiceDB test container's fixed 20 minute Expire(1200) with a lifetime derived from the running test binary's own -test.timeout (timeout plus 2m, floor 20m, 2h when there is no timeout), and moves the e2e and bronze package timeout to one shared 40m constant.
Verdict: no blockers; approved. A second, independent pass looked only for blockers and found none. What it confirmed:
- The backstop still works for long lifetimes.
ExpireissuesPOST /containers/<id>/stop?t=Nfrom a goroutine withcontext.Background(), and the docker client sets no request timeout, so nothing on the client side cuts a 42m or 2h stop short. - The flag is always read after parsing.
startContainer's only callers areEndpoint(t)andSharedEndpoint(t), which run insidem.Run. A read before parsing would see 0 and take the safe 2h fallback. - Nothing else depends on the old 20m cap. The reaper decides by owner PID, run ID and label, not by age, and there is no other fixed TTL in the repo.
- CI time still fits. The e2e job's worst case is about 55m (40m for the package run, 10m for cmd/oap
TestApInitLocal, plus build time) against its 90mtimeout-minutes. - The new tests compile and run under both
integrationande2e, matchingserver.go's build tag.
Two nits from review are fixed in c8a93c0, pushed to this branch:
TestTestBinaryTimeout_ReadsTheRunsOwnTimeoutnow checks that the timeout it reads matches the run's own-test.timeout: the value minus the time left untilt.Deadline()must equal how long the binary has been running, within 5s. AtestBinaryTimeoutthat returned a hardcoded 25m fails it (checked), where the oldassert.Positivepassed.testBinaryTimeoutnow writes a line to stderr before falling back to the 2h lifetime whentest.timeoutexists but does not read as atime.Duration, per the repo's no-silent-errors rule. An absent flag stays silent.
Verified locally: go vet under integration and e2e, the lifetime tests under both tags and with -timeout=0, and the full test/testspicedb package against Docker.
Questions for the author:
test:steelstill runs./test/e2e/steelthread/...at 10m while the same package gets 40m undertest:e2e. Is the 10m fast-fail intended for the steel tier?- The 40m budget leaves about 16m over the 24m busy-runner time for bronzethread. Is there a tracking issue or threshold check for splitting that package before new bundles consume the headroom?
This review was drafted by an automated pipeline and checked before submission.
End-to-end runs have started failing on unrelated pull requests: the last few scripted scenarios report that SpiceDB refused the connection.
The test setup stops its SpiceDB container 20 minutes after starting it, as a safety net for a test run that was killed. The scripted-scenario package now takes longer than that on a busy CI runner (about 24 minutes, against 19 on an idle one), so the container was being stopped while scenarios were still running.
Changes:
mage test:bronzeruns that package too and was still set to 10 minutes; it now uses the same value.This does not make the suite faster. The scripted-scenario package keeps growing with every scenario added, and splitting it is the longer-term fix.
Testing
A unit test covers how the container's lifetime is derived from the test timeout. The end-to-end run on this pull request exercises the change itself.