Skip to content

Fix flaky TaxonomyBrowser visualization unit tests #581

Open

Description

Type

Bug

Scope

Multi-theme or Platform

Skillset

dev ops

Description

Some TaxonomyBrowser visualization tests in src/components/__tests__/taxonomyBrowser.test.jsx fail intermittently. When they fail, Unit tests and are-we-good fail on PRs that don't touch the component. For example, #580 changes only an .mdx file and failed, then passed on re-run (failed job).

Failures seen:

  • viewport zoom and pan > still works when a zoom control is pressed with a shaky hand: expected 1 to be greater than 1
  • viewport zoom and pan > pans by the drag delta: expected { x: +0, y: +0, k: 1 } to match object { x: 60, y: 30 }
  • canvas sizing > fills the space it is given rather than a fixed size

Local repro on main code: npx vitest run src/components/__tests__/taxonomyBrowser.test.jsx failed 2/30 runs. Running only -t "viewport zoom and pan" passed 30/30, so earlier tests in the file seem to be involved.

Suspected cause (unconfirmed): showSunburst() returns once the sunburst is in the DOM, possibly before its passive effects run. Those effects are the window pointer listeners and the mount-time resetView() in src/components/taxonomyViz.jsx. A late resetView() would undo the test's zoom or pan.

Acceptance criteria:

  • Find and fix the root cause in the component or tests, without just adding retries.
  • The full test file passes on repeated local runs, e.g. 50 in a row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions