Commit 70b9066
authored
fix: stabilize legacy workspace session_count test (#325)
## Summary
Hardens `agent-gateway` `sums session_count across legacy split buckets
of one root`.
External session seeds are not watched into the minidb read model.
`PYTHINKER_CODE_WATCH` only reloads `workspaces.json` (150ms debounce).
Session counters update on boot project, API/mirror dirty marks, or the
60s reconcile tick. The old test wrote buckets under a live server and
polled with the default 1s `waitFor`, so CI could observe a folded
workspace with a stale count of 1.
## Change
- Fresh home for the case
- Seed both legacy buckets on disk
- Restart the same home so boot projection indexes both dirs
- 10s `waitFor` (same budget as the sibling sessions read-model test)
Test-only. No product change. No changeset.
## Test plan
- [x] `pnpm --filter @pymodel/agent-gateway exec vitest run
test/workspaces.test.ts`
- [ ] CI green on this PR
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Improved workspace consolidation test reliability by resetting server
state between test phases.
* Added coverage for restarting with either a fresh or existing home
environment.
* Added explicit timeout handling while waiting for workspace
consolidation and session counts.
* Improved cleanup behavior and retry handling for temporary test
environments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 96d1a0c commit 70b9066
1 file changed
Lines changed: 51 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
71 | 109 | | |
72 | 110 | | |
73 | 111 | | |
| |||
206 | 244 | | |
207 | 245 | | |
208 | 246 | | |
| 247 | + | |
209 | 248 | | |
210 | 249 | | |
211 | 250 | | |
| |||
246 | 285 | | |
247 | 286 | | |
248 | 287 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
257 | 300 | | |
258 | 301 | | |
259 | 302 | | |
| |||
0 commit comments