← Back to Pull requests

fix: improve scale-test pagination robustness #22

Closed
talhil-rh closed this pull request without merging on Jun 15, 2026 14:22 UTC
View on GitHub
talhil-rh talhil-rh commented on May 30, 2026 18:51 UTC
Author

Summary

  • Total-count guard: Assert pagination shows 50 total items before paginating — catches simulator/enrollment count mismatches early with a clear error instead of cryptic row-count failures on later pages

  • Wait for Online status: scaleFleetSimulatorWaitForDevices now defaults to requiredStatus: 'Online', ensuring all 50 devices have fully enrolled before the UI test begins (previously only checked device existence)

  • Page number assertion: After each "Go to next page" click, verify the pagination input shows the expected page number — detects swallowed clicks that would silently re-assert page 1

  • Row wait after page change: clickEnrolledDevicesNextPage() now waits for both the spinner to disappear AND at least 1 row to render, preventing transient 0-row assertions during table re-render
  • Test plan

  • Run CI/edge-management-flightctl-standalone-ui with this branch to verify the scale-test passes

  • Verify no regressions in the decommission + label detach/reattach sibling tests
  • Attribution


    Requested by: @thilzenr

    🤖 Generated with Claude Code

    Diff: 149 lines (+99 / -50) across 3 files Reviewer: talhil-rh Review duration: 22771m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.55) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 149 lines diff across 3 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.300
    Shallow Review Depth shallow_review_depth
    0.289
    Self Review self_review
    0.140
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    2 items
    talhil-rh talhil-rh commented on Jun 08, 2026 23:28 UTC
    Reviewer

    🤖 AI Code Review

    Verdict: APPROVE (with comments — merge conflicts must be resolved first)

    Gate Checks


    ✅ PR Description: Clear summary with 4 bullet points, test plan, attribution
    ✅ CI Status: No CI checks configured on this repo
    ✅ Single Concern: All changes address scale-test pagination robustness
    ✅ Reasonable Scope: 3 files, +105/-46 lines
    ✅ No Secrets: Clean
    ✅ Not a Draft

    Findings Summary


    | Severity | Count |
    |----------|-------|
    | Critical | 0 |
    | High | 0 |
    | Medium | 2 |
    | Low | 2 |

    Medium Issues

    1. Merge conflicts — PRs #24 and #25 were merged into main after this PR was opened. Two of the three files (devicesPage.js, scaleFleetSimulatorTasks.js) now have merge conflicts. The PR cannot be merged in its current state. A rebase onto main is needed. Many changes from this PR (e.g., scaleFleetEnsureExists, stale data cleanup, scaleFleetCleanup, fleet label detach/reattach test) are already in main via PR #24 — the rebase should drop those and keep only the unique pagination-robustness changes.

    2. expectEnrolledDevicesTotalPages false-positive risk (devicesPage.js:317) — Uses contain.text with of ${expectedPages}, which would match "of 40" when checking for "of 4" (substring match). Not a practical issue at 50 devices / 15-per-page, but a more precise regex assertion would be safer:

       .should(($el) => {
         const text = $el.text().trim()
         expect(text).to.match(new RegExp(`of ${expectedPages}$`))
       })
       

    Low Issues

    1. cy.wait(1200) hardcoded delay in filterByFleetScaleLabel (devicesPage.js:304) — acceptable for typeahead debounce, but a retry-based approach would be more robust.

    2. Significant overlap with already-merged PR #24 — after rebasing, the effective diff will be much smaller (only the unique pagination logic, requiredStatus filter, compact pagination handling, and typeahead selector fix).

    Recommendation

    The code quality is solid — the iterative fixes across 5 commits correctly address real CI failures (typeahead selector, PF6 compact pagination, status filtering). Rebase onto main to resolve merge conflicts, then this is ready to merge.

    Reviewers
    Assignees
    talhil-rh talhil-rh
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.9% (MEDIUM) · Higher = larger blast radius
    54.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.7% · Safe to merge
    21.7%