Commit e8388f1
test(run-ops): stub org-data-stores registry singleton + deterministic empty CH window
Two webapp unit-test shards were red on this branch:
- Shard 6 (apiRetrieveRunPresenter.readroute.test.ts): the
organizationDataStoresRegistry singleton is constructed at import (pulled in
transitively via the ClickHouse factory instance) and immediately fires a
`forever` pRetry(loadFromDatabase) plus a setInterval reload against
db.server's $replica. In CI (no Postgres on localhost) those retry forever and
saturate the worker event loop, timing out an awaiting test's hook. Mock the
instance module to a no-op in test/setup.ts, mirroring the other eager-singleton
stubs. No unit test uses this singleton — the registry-behavior tests construct
the class directly — so this is safe and should also help other shards/branches
that import the presenter graph.
- Shard 2 (nextRunListPresenter.readthrough.test.ts): the two empty-state tests
seeded a run then assumed it had NOT yet replicated to ClickHouse within the page
window, so result.runs would be empty. That held on a slow local stack but raced
on CI, where replication had completed and the run surfaced (length 1, not 0).
Scope those two calls to a `to` one hour in the past; the CH page filters
created_at <= to, so a just-created run is deterministically excluded regardless
of replication timing. The PG existence probe has no time filter, so it still
finds the row and hasAnyRuns stays true — the exact behavior each test verifies.
Reproduced both failures and verified the fix under a CI-faithful env (DATABASE_URL
+ REDIS at dead ports, GITHUB_ACTIONS=true, --no-file-parallelism): shard 2 now
18 files / 118 tests green, shard 6 now 16 files / 212 tests green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3f05a69 commit e8388f1
2 files changed
Lines changed: 33 additions & 3 deletions
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
| |||
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
212 | | - | |
| 222 | + | |
213 | 223 | | |
214 | 224 | | |
215 | 225 | | |
| |||
337 | 347 | | |
338 | 348 | | |
339 | 349 | | |
340 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
341 | 355 | | |
342 | 356 | | |
343 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
143 | 159 | | |
144 | 160 | | |
145 | 161 | | |
| |||
0 commit comments