Commit 1b71d76
committed
test(a2ui-toolkit): de-flake deep child-chain cycle tests
The two deep-chain cycle tests in validate.test.ts intermittently tripped
vitest's 5000ms default timeout on CI (~5358ms), reddening the unit
workflow's typescript job repo-wide.
Root cause is not the validator: validateA2UIComponents on the 50k chain
runs in ~59ms (build 6ms + validate 53ms). findChildCycles is already a
linear, Set/Map-backed iterative DFS — no quadratic scan to fix. The
flake is GC/scheduling jitter: each test allocates ~150k objects (50k
components + 50k DFS frames + path/adjacency), and two such tests under
parallel-fork contention on a 2-vCPU runner stall on GC, inflating
wall-clock far past CPU time.
Fix (test-only — validator left untouched, it is optimal):
- N 50000 -> 20000 in both deep tests. V8's recursive overflow depth is
~8807 (trivial frame; lower for a real DFS frame), so 20k is still >2x
past it and proves the walk is iterative, while cutting allocations
2.5x to shrink the GC-stall window.
- Add an explicit 30000ms timeout to decouple the provably-fast
assertion from CI runner scheduling jitter.
Toolkit suite: 84/84 pass, validate.test.ts ~103ms.1 parent 7248d71 commit 1b71d76
1 file changed
Lines changed: 33 additions & 19 deletions
Lines changed: 33 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
201 | 215 | | |
202 | 216 | | |
203 | 217 | | |
| |||
0 commit comments