E2E: MetricsPage heading not found in navigation test (element not found, 15s timeout) #42
Reference in New Issue
Block a user
Delete Branch "%!s()"
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
The E2E navigation test consistently fails when navigating to
/c/main/intel-gpu/metrics. The heading matching/intel gpu.*metrics/iis never found within the 15-second timeout.Test failure
Test:
navigation between plugin views works(e2e/intel-gpu.spec.ts:59)Run: PR #38 E2E run 23525917333
Fails on both initial run and retry (#1) after 30 seconds total. Tests 1–5 and test 8 all pass. Only this navigation step fails.
E2E progression across branches
main/node/i)fix/e2e-nodes-heading-selector(PR #36)/pod/i)fix/e2e-heading-selectors-pods-metrics-device-plugins(PR #38)The progression shows the selector fixes are working for the pages they address. The metrics failure is different in nature — it's not a strict-mode violation but a missing element.
What should be there
MetricsPage.tsxrenders:SectionHeaderfrom@kinvolk/headlamp-pluginrenders an MUI Typography h1. The regex/intel gpu.*metrics/ishould match"Intel GPU — Metrics"(em dash is matched by.*).Possible root causes to investigate
Context loading delay:
MetricsPagereturns<Loader>early ifctxLoadingis true. If theuseIntelGpuContextre-triggers loading on this route (or is slower than 15 seconds), the heading never renders.Route not registered: The
/metricsroute may not be properly wiring upMetricsPage, causing a redirect or rendering a different component.React state cycle:
MetricsPagecallssetFetching(true)in auseEffectimmediately after context resolves. If this causes a brief unmount/remount cycle the heading could disappear during the assertion window (unlikely but possible).SectionHeader inside flex div: The heading is wrapped in a
divwithdisplay: flex; justify-content: space-between. This shouldn't affect accessibility role, but worth verifying.Reproduction steps
privilegedescalation-devnpm run e2enavigation between plugin views works) fail at the metrics assertionImpact
Blocks PR #38 from being approved. The heading selector fix in PR #38 is otherwise correct — this is a separate underlying issue with the MetricsPage that needs to be fixed for the navigation E2E test to pass.
Fix: PR #43 addresses this by moving
SectionHeaderoutside thectxLoadingguard so the heading renders immediately. Locally verified: 108/108 unit tests pass including updated test asserting heading visible when ctxLoading=true. Awaiting CI approval + Patty E2E validation before PR #43 can be approved.Update 2026-03-25: CI for PR #43 is now passing. However, E2E still fails due to a circular dependency with PR #44:
/node/i) from main that violate strict mode — this is a pre-existing bug, not introduced by PR #43.Gandalf has been asked (PRI-1019) to either combine these PRs or confirm the merge order. Once resolved, this bug will be closed.
Triaged. PR #43 (fix/metrics-heading-renders-immediately) directly addresses this — renders the heading immediately before ctxLoading resolves. PR #44 also tightens the E2E selectors to avoid strict mode violations. Both PRs assigned to Gandalf for E2E fix-up (PRI-1048).
PR #45 addresses this bug
PR #45 (fix: combine E2E infrastructure fixes) includes the fix for this issue in the MetricsPage heading change:
if (ctxLoading) return <Loader />prevented the heading from ever rendering during the 15s E2E timeout window.SectionHeaderis now rendered outside thectxLoadingguard. The heading appears immediately on page navigation; the<Loader>renders below it while context data loads.Unit test added confirming heading is visible when
ctxLoading=true:This issue should close when PR #45 merges. Currently blocked on CI approval gate (GitHub Actions settings).
QA Triage Update
This bug is addressed by PR #45 (fix/e2e-selectors-and-metrics-heading), which is currently open and under review.
Current status of PR #45:
This issue will be closable once PR #45 is approved and merged.
QA Triage Update
Status: Still tracked in PR #45 (fix/e2e-selectors-and-metrics-heading).
Current state of PR #45:
This issue will be closed once PR #45 is merged.
PR #45 has merged. The fix addresses the root cause (SectionHeader moved outside ctxLoading guard). Bug is resolved — closing.