Flaky: models.dev refresh 'lets one of two runs at the same time work' on Postgres (#548-T03)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 83/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- postgresql, typescript
Research direction
Start with app/src/models-dev/service.integration.test.ts and the named test, then inspect how its fake fetch and the two refresh() calls are coordinated. Make the first fetch remain pending until the second call returns skipped, so the overlap is deterministic. Done when the test consistently gets one applied and one skipped result.
Written by the indexing model from the issue text.
Description
app/src/models-dev/service.integration.test.ts > "the models.dev fetch on postgres" > "lets one of two runs at the same time work and answers the other at once" (// #548-T03) fails now and then.
Seen: 1 in 4 runs against a throwaway Postgres 18 (embedded-postgres, fsync=off, 2 vitest workers on a 4-core machine); the other runs of the same file were green (74/74). Found while working on #555 (PR #579), which does not touch src/models-dev/.
Failure:
expect(outcomes.map((o) => o.status).sort()).toEqual(["applied", "skipped"])
- "skipped"
+ "applied"
Both refresh() calls ended applied: the first run was already done (lock released) before the second one asked, so the second took the lock too. The test assumes the two calls overlap, which depends on timing.
Suggested fix: make the overlap deterministic (hold the first fetch open on the fake, for example a scripted hang released after the second call answered skipped) instead of relying on Promise.all timing.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 1h 18m
- Merged PRs (30d)
- 284
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ExpidetGames/code-reviewer
-
area: app type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ExpidetGames/code-reviewer#585 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ExpidetGames/code-reviewer#464 ·
Maintainers usually reply within 1 day
-
area: app type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ExpidetGames/code-reviewer#308 ·
Maintainers usually reply within 1 day
-
type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ExpidetGames/code-reviewer#94 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
ExpidetGames/code-reviewer#583 ·
Maintainers usually reply within 1 day
All issues in ExpidetGames/code-reviewer
Similar issues
-
Area/Cloud Needs Triage Type/Bug
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
wso2/product-integrator#2847 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
bluesky-social/social-app#12118 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
heygen-com/hyperframes#6021 ·
Maintainers usually reply within 1 day
-
check:passed streams:edit
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day