Skip to content

Comments

fix(ui): use deterministic timestamps in dynamic host volume Percy test#27553

Draft
aklkv wants to merge 1 commit intomainfrom
ember-upgrade/fix-flaky-percy-timestamps
Draft

fix(ui): use deterministic timestamps in dynamic host volume Percy test#27553
aklkv wants to merge 1 commit intomainfrom
ember-upgrade/fix-flaky-percy-timestamps

Conversation

@aklkv
Copy link
Contributor

@aklkv aklkv commented Feb 20, 2026

Description

Fixes flaky Percy snapshot tests, Percy visual diffs from random Mirage data, and consistently failing "clicking legend item" tests for sysbatch/parameterized child jobs.

  • Deterministic Percy timestamps — Replace faker.date.past() with fixed timestamps in the dynamic host volume detail test. Freeze moment.now during the snapshot (wrapped in try/finally for safety).
  • Fix legend item test failures — The Mirage job factory wasn't passing allocStatusDistribution to child jobs for periodic/parameterized parents. Children received random allocation statuses instead of the parent's { running: 1 }, sometimes producing all "queued" allocations that made the clickable legend selector return null.
  • Fix duplicate Percy snapshot names — Tests calling percySnapshot(assert) multiple times in the same test produced duplicate names. Added explicit unique names in actions-test.js, jobs-list-test.js, and sentinel-policies-test.js.
  • Seed faker for Percy stability — Added faker.seed(1) before Percy snapshots across 11 test files to ensure deterministic Mirage data (job names, priorities, task groups, allocation bars, etc.). Seeds are placed in individual test bodies or beforeEach hooks close to the snapshots that need them, avoiding interference with unrelated tests in the same module.

Testing & Reproduction steps

  • The legend item tests for sysbatch child and parameterized child jobs should no longer fail with Cannot read properties of null (reading 'parentElement').
  • Percy should no longer warn about duplicate snapshot names.
  • Percy visual diffs caused by random Mirage data will be eliminated. The first Percy build after merge will show diffs against old (unseeded) baselines — once those are accepted, all subsequent builds will produce stable, identical snapshots.

Links

Contributor Checklist

  • Changelog Entry N/A — test-only changes, no user-facing behavior change.
  • Testing Fixes existing flaky tests.
  • Documentation N/A — no user-facing changes.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge" in the majority of situations.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry within the public repository.
  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

No changes to security controls.

Pin allocation createTime/modifyTime to fixed values and freeze moment.now
to a matching reference point so both absolute dates and relative times are
identical across Percy snapshot runs.
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