Cut polling/auth round trips; stop E2E timing out in CI - #30
Merged
Merged
Conversation
counterState and dbStatus each become one statement (the database size is memoised for a minute), the REST guard hands back the event it resolved instead of handlers looking it up again, the finished-runner count only runs when it can change the capability set, the course-map window preview shares the tile render gate, and controlCompletionStatus loads only the requested course's runners and their cards. Co-authored-by: Cursor <cursoragent@cursor.com>
Four full stacks on a 4 vCPU runner ran every shard at half speed and pushed 5 s expect budgets over; the shard count now follows the core count. The runner create/edit/delete test derives its name and card from the retry index so a slow first attempt cannot turn into a duplicate-card dialog on retry, and the two long course-editor tests declare themselves slow instead of racing the 30 s test timeout. Co-authored-by: Cursor <cursoragent@cursor.com>
…ound-trips Cut polling/auth round trips; stop E2E timing out in CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same two commits as #29, now against
main— #29 was merged into its base branch after #28 had already landed, so this brings them home. Branch CI for these exact commits: green (Running 44 spec files across 2 shards).Summary
257deff— performance sweep (docs/perf-polling-and-auth-round-trips.md). Follow-up to the Cloud Run log review: the recurring slow endpoints were all polls or per-request plumbing.competition.counterState(every 5 s/tab): 9 sequential queries → 1 statement with scalar subselects.competition.dbStatus(every 3 s/tab, public): 3 queries → 1;pg_database_size()memoised 60 s (ttl-memo.ts).assertRestAccessreturns the resolvedEventRefso handlers stop looking the slug up twice;countFinishedRunnersonly runs when it can change the capability set (finishedCountMatters). Semantics unchanged./api/maps/:nameId/window.pngrasterises under the sharedrenderGate()with the same 503/Retry-Afterbehaviour as tiles.course.controlCompletionStatus(every 15 s) loads only the requested course's runners and the cards they carry.online-input-config.spec.ts.00ca4ed— CI E2E failures. Everymainrun since #26 failed the E2E job (blockingpublish); all failures were timeouts from four full stacks on a 4 vCPU runner.scripts/e2e-sharded.mjs: default shard countmin(4, floor(cores/2));E2E_SHARDSstill overrides.phase2.spec.tscreate/edit/delete derives names and card number fromtestInfo.retry(the one deterministic failure: a slow first attempt left a runner that made every retry hit the duplicate-card dialog).test.slow().docs/e2e-sharding.md,AGENTS.mdupdated.Test plan
pnpm build,pnpm test(612 api / 867 web / 292 shared)CI=1 E2E_SHARDS=2: 275 passed, 0 retriesoxygen-api/oxygen-webrebuilt and startedpublishruns again and:edgepicks up Fix map-tile cold-render timeouts on Cloud Run #28 + thisMade with Cursor