Skip to content

TEST: History pagination race - #4014

Open
Roman Lutz (romanlutz) wants to merge 3 commits into
microsoft:mainfrom
romanlutz:romanlutz-scenario-history-pagination
Open

Roman Lutz (romanlutz) wants to merge 3 commits into
microsoft:mainfrom
romanlutz:romanlutz-scenario-history-pagination

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

Repair the Scenario History pagination test's readiness race. The old wait observed listRuns dispatch, not response settlement, so it could assert Page 2 while pagination was intentionally hidden during loading. Its filter rerender also removed the original <main> wrapper, remounting the component instead of checking retained state.

Use the existing deferred-response helper to exercise the pending and settled states deterministically. Keep the same component tree during filter changes and retain assertions for serialized filters, the supplied next-page cursor, visible Page 2 and its distinct result, first-page cursor reset, and refreshed results with filters preserved.

This is a test-only repair, not a proved production pagination defect. No production source or user-facing behavior changes. Preserve the QUEUED-only URL coverage from #3815 and include latest upstream main through #3526. Independent review found no actionable issues, including a final check after the upstream refresh.

Tests and Documentation

Validated final head cc7b75c17b96956dac9d53f550cde643b23d8a35, merged with upstream main 0f5f6589e92824268b5151409ad19c8593e1dc5a:

  • npm --prefix frontend test -- --runInBand --runTestsByPath src\components\History\ScenarioHistory.test.tsx --testNamePattern='serializes filters, paginates by cursor, and refreshes from the first page': passed, 1 selected test and 32 skipped, without React act warnings.
  • npm --prefix frontend test -- --runInBand --testPathPatterns='components.History' --silent: passed, 143 tests across 7 suites.
  • Set-Location frontend; npm exec -- eslint src\components\History\ScenarioHistory.test.tsx --report-unused-disable-directives --max-warnings 0: passed.
  • npm run type-check from frontend: passed.
  • git diff --check and git diff --check origin/main...HEAD: passed.

Documentation and JupyText are not applicable to this frontend test-only change. No provider or model calls were made.

Wait for settled pagination, keep filter rerenders on the same component, and exercise deferred responses with preserved cursor/filter assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

# Conflicts:
#	frontend/src/components/History/ScenarioHistory.test.tsx
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 20:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the test-only improvements to Scenario History pagination coverage.

No open issues 🎉

What changed in this PR

This test-only change makes Scenario History pagination coverage deterministic without changing production behavior.

Changes:

  • Uses deferred responses to verify loading states before asserting settled pagination and distinct results.
  • Preserves the component tree during filter changes, checking cursor reset and refreshed results with filters retained.
File Description
frontend/​src/​components/​History/​ScenarioHistory.test.tsx Repairs pagination readiness waits and strengthens filter-change and refresh assertions.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants