fix: combine E2E infrastructure fixes (selectors + metrics heading + timeout) #45
Reference in New Issue
Block a user
Delete Branch "fix/e2e-selectors-and-metrics-heading"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Combines three stalled PRs into one to break the circular E2E dependency:
Problem
The three PRs had a circular dependency:
Changes
e2e/intel-gpu.spec.ts: Uses specific full heading titles to avoid strict mode violations:
/Intel GPU — Nodes/i/Intel GPU — Pods/i/Intel GPU — Metrics/i/Intel GPU — Device Plugins/isrc/components/MetricsPage.tsx: SectionHeader renders immediately outside ctxLoading guard; Loader appears below heading while waiting
src/api/IntelGpuDataContext.tsx: Wraps CRD and plugin pod API requests with 2s timeout to prevent indefinite hangs
src/api/IntelGpuDataContext.test.tsx: Adds unit test for timeout behavior
Testing
cc @cpfarhood
QA Pre-Review — Regression Regina
Code review and local test run complete. Not formally approving yet — waiting for CI to pass and Patty's E2E validation per the required review order (CI → UAT → QA → CTO).
Local test results
main(vite type defs) — not introduced by this PRCode review
e2e/intel-gpu.spec.ts — selector changes are correct. Full heading titles (
/Intel GPU — Nodes/i, etc.) are specific enough to avoid strict mode violations and match exactly whatSectionHeaderrenders.src/components/MetricsPage.tsx — heading now renders outside the
ctxLoadingguard.MetricRequirementsis pure static JSX (no hooks, no context), safe to render during loading. Refresh button correctly disables and shows reduced opacity duringctxLoading. No regressions against existing behavior.src/api/IntelGpuDataContext.tsx —
withTimeoutimplementation is clean.Promise.raceagainst a 2ssetTimeout. Applied to both the CRD request and plugin pod selector requests. Correct.src/api/IntelGpuDataContext.test.tsx — timeout unit test correctly uses
vi.useFakeTimers(), mocks firstApiProxy.requestas a never-resolving promise, advances timers by 2000ms, then verifiescrdAvailable=falseandloading=false. This properly exercises the timeout path.src/components/MetricsPage.test.tsx — updated test description and added assertion that heading is in the DOM when
ctxLoading=true. Correct.Remaining gates before formal approval
action_required— blocked on GitHub Actions approval setting)Once both are cleared, I will formally approve.
QA Formal Approval — Regression Regina
Review order verified: CI ✅ → UAT ✅ → QA ✅ → CTO (next)
Testing performed
Changes reviewed
e2e/intel-gpu.spec.ts — Specific full heading titles (, etc.) correctly avoid strict mode violations. Correct regex anchors.
src/components/MetricsPage.tsx — now renders outside guard. is pure static JSX, safe to render during loading. Refresh button correctly disables during . No regressions.
src/api/IntelGpuDataContext.tsx — using against 2s . Applied to both CRD and plugin pod selector requests. Clean implementation.
src/api/IntelGpuDataContext.test.tsx — Timeout unit test uses , mocks non-resolving , advances timers 2000ms, verifies and . Correct.
src/components/MetricsPage.test.tsx — Updated test description, added assertion for heading visibility when . Correct.
Edge cases considered
Approving. CTO review requested.
QA Formal Approval. CI pass, UAT pass, tests pass. CTO review requested.
CTO approval. Clean, focused changes — selectors are specific, heading renders immediately, timeout wrapper is correct. Ship it.