Skip to content

Fix flaky TriangleModelWindow tests and clear critical dependency advisories - #8

Merged
ycli0536 merged 7 commits into
mainfrom
claude/elastic-goldstine-fe6896
Aug 31, 2026
Merged

Fix flaky TriangleModelWindow tests and clear critical dependency advisories#8
ycli0536 merged 7 commits into
mainfrom
claude/elastic-goldstine-fe6896

Conversation

@ycli0536

@ycli0536 ycli0536 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Flaky test fix: three TriangleModelWindow.test.tsx tests failed intermittently when the full suite ran on a loaded machine. Reproduced under induced CPU load: the failures are vitest's default 5s testTimeout tripping on the file's interaction-heaviest tests, which idle at ~0.5s but inflate ~10x under worker contention. Raised testTimeout to 20s and testing-library's asyncUtilTimeout to 5s — both are give-up bounds, so green runs pay nothing.
  • Dependency updates, minor tier: bun update across 45 packages within existing ranges. Clears the critical vitest UI-server arbitrary-file-read advisory (GHSA-5xrq-8626-4rwp) plus postcss, axios, lodash, and jsdom advisories. Audit findings drop 86 → 30 with zero critical.
  • Dependency updates, major tier: vite 5 → 8 (Rolldown bundler, production builds ~6s → ~1.5s), @vitejs/plugin-react-swc 3 → 4, vitest 3 → 4, jsdom 28 → 30. Clears the esbuild dev-server CORS advisory and rollup/vite path-traversal advisories vite 5 pinned us to (audit 30 → 25). Migration: a real duplicate import in src/embed/index.ts that Rolldown's stricter parser caught, constructible mock implementations for vitest 4 spies, and import.meta.dirname in configs.
  • Type cleanup + CI gate: tsc --noEmit had 72 long-standing errors CI never caught (vite build strips types without checking). All fixed behavior-preservingly, surfacing several real bugs (duplicate object key, dataBlocks: [] vs {}, an ineffective isDisabled prop, dead stopPropagation). frontend/package.json gains a typecheck script and CI now runs it between lint and build.
  • gitignore fix: the bare test/ pattern silently ignored new files under the tracked frontend/src/test/; scoped it to /test/.

Verification

  • Full suite 3x unloaded after the timeout fix, plus green under the induced 64-process CPU load that failed pre-fix
  • After each dependency tier: vite build, demo build, eslint, and the full suite (268/268)
  • tsc --noEmit clean (72 → 0); typecheck, lint, both builds, and tests all green on the final tree

🤖 Generated with Claude Code

ycli0536 and others added 7 commits August 30, 2026 22:08
…sdom tests

The TriangleModelWindow tests idle at ~0.5s each but inflate ~10x when
parallel vitest workers contend for CPU on a loaded machine, tripping the
default 5s testTimeout (reproduced: 'Test timed out in 5000ms' under
induced load). Raise testTimeout to 20s and testing-library's
asyncUtilTimeout to 5s — both are give-up bounds, so green runs pay
nothing, and waitFor failures keep their informative DOM-dump errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bun update within existing semver ranges (45 packages, no majors):
vitest 3.2.7 fixes the critical UI-server arbitrary file read
(GHSA-5xrq-8626-4rwp); postcss 8.5.26, axios 1.20.0, lodash 4.18.1,
and jsdom 28.1.0 clear their advisories. Also dropped two stale
nested postcss@8.5.6 lockfile entries whose ranges already allowed
the fixed version. Audit: 86 -> 30 findings, zero critical.
Verified: vite build, lint, and the full test suite twice (268/268).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The bare test/ pattern matched at any depth, so new files under the
tracked frontend/src/test/ vitest setup directory were silently
ignored. /test/ keeps ignoring only the top-level scratch directory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
vite 5.4.21 -> 8.2.2 (Rolldown bundler, builds drop from ~6s to ~1.5s),
@vitejs/plugin-react-swc 3 -> 4, vitest 3.2.7 -> 4.1.11, jsdom 28 -> 30.
Clears the esbuild dev-server CORS advisory and the rollup/vite
path-traversal advisories that vite 5 pinned us to (audit 30 -> 25).

Migration fallout, all behavior-preserving:
- Rolldown's stricter parser caught a real duplicate mountApp import
  in src/embed/index.ts that rollup silently tolerated.
- vitest 4 spies pass `new` through to the implementation, so the
  ResizeObserver/IntersectionObserver/uPlot constructor mocks move
  from arrow implementations to constructible functions.
- Config files use import.meta.dirname instead of __dirname (vite 8
  native config loader deprecation).

Verified: vite build, demo build, lint, and the full suite (268/268).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tsc --noEmit had 72 long-standing errors that CI never caught (it only
ran lint, vite build, and vitest; vite strips types without checking).
All fixes are behavior-preserving. Real bugs surfaced along the way: a
duplicate Tx_id key in a mock literal, dataBlocks mocked as [] where
the store uses {}, a FileTrigger isDisabled prop that react-aria never
accepted (the inner Button already handles disabling), and a dead
stopPropagation on a callback that is invoked without an event.

The uplot wheel-zoom plugin drops its hand-rolled UPlotInstance type
for real uPlot types plus null guards (re-declared as explicitly typed
consts, since guard narrowing does not reach hoisted nested handlers).
The triangle viewer reuses a module-level Vector2 for raycasting NDC
coordinates instead of an untyped literal.

frontend/package.json gains a typecheck script and ci.yml runs it
between lint and build so type errors cannot accumulate again.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The minor-tier npm update moved @tauri-apps/api to 2.11 and the plugin
packages forward, which desktop-validate rejects when the Rust crates
lag behind ('version mismatched Tauri packages'). Bump tauri to 2.11
and cargo-update the plugin crates so every npm/Rust pair is on the
same minor (verified with tauri info and cargo check).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The config has declared the v8 coverage provider all along, but the
provider package was never installed, so vitest --coverage errored.
Verified: full suite with --coverage passes (268/268, 65.8% stmts).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ycli0536
ycli0536 merged commit b0276c2 into main Aug 31, 2026
10 checks passed
@ycli0536
ycli0536 deleted the claude/elastic-goldstine-fe6896 branch August 31, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant