Skip to content

test(Switch): hold the travel from its start - #10316

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:hold-switch
Nov 7, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:hold-switch

Conversation

@vjeux

@vjeux vjeux commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

On a loaded runner, two Switch tests held the switch's travel after it had already ended. At one CPU with 4 workers, on #10286's head, the travel test passed 2 of 10 runs and the tap storyboard 8 of 10.

Intended invariant

The harness's armHold documentation says to arm it before the action that starts the animation. A hold sent once the animation runs reaches the page later the busier the machine is.

Change

  • "the travel and the track colour follow the UIKit springs" arms armHold on the switch before the programmatic change.
  • "storyboard: tap — travel" arms armHold before the tap, with a count of 3. The press starts two animations. The release starts its travel with several others at once, so the hold lands at the release. The storyboard takes what the hold took.
  • The storyboard first checks that the travel is among the held animations. A hold that misses the travel then fails, instead of filming the wrong motion (architecture:component-test-sufficiency INV6).
  • Both tests drop the thumb that only the old wait used.

Each armHold names the thumb's translate with judges. In the storyboard, that replaces its own check for the travel.

Evidence

  • Failure before the change: on test: watch before the action at 28 first-contact waits #10286's head, at one CPU, the travel test held the thumb at rest ({"t":0,"actual":0,"expected":-16}). The storyboard's frames ran past the on end, to 25.3 and 30.7 px against 16.1.
  • Success after the change: both tests passed every run, at one CPU, under CI's WebKit profile and in Chromium.
  • Product/runtime behavior verified unchanged: the diff is in one test file only.
  • CI impact: none; no workflow or CI script changes.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

# WebKit, one CPU, 4 workers: #10286's head and this change, alternating
podman run --cpus=1 -e CI=1 … mcr.microsoft.com/playwright:v1.61.1-noble \
  node ./node_modules/@playwright/test/cli.js test \
  --config playwright.interaction.config.ts --project=webkit \
  --workers=4 --retries=0 --repeat-each=5 <the two tests>
# CI's WebKit profile: --cpus=4, 1 worker, --repeat-each=10
# Chromium: two pinned CPUs, --workers=4 and --workers=1

Counts:

  • WebKit, one pinned CPU, 4 workers, two rounds of 5 runs per arm, first arm alternating. test: watch before the action at 28 first-contact waits #10286's head passed 10 of 20, and this change 20 of 20.
  • CI's WebKit profile (--cpus=4, 1 worker), 10 runs: 20 of 20.
  • Chromium, two pinned CPUs, 4 workers, 5 runs per arm: 10 of 10 in each arm.
  • Chromium, two pinned CPUs, 1 worker, 10 runs: 20 of 20.
  • Core tsc --noEmit passes, and ESLint reports no new findings in the file.

@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 7, 2026 4:28am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 6, 2026
@astracat-bot

astracat-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 4:39 AM UTC

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 25979cd

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Switch · Storybook 97.8 kB (0) · 9.9 kB CSS (0) 1,725 (0) ✓ · ✓ · ✓

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 19 rows, core 24 rows; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 6, 2026
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec cdd6bdb

@astracat-bot astracat-bot Bot 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.

Approved pending CI: CI has not run on this head yet, because the pull request is a draft. It already carries the ci:run label, so marking it ready for review starts CI.

The Switch travel test and tap storyboard now hold the travel from its start, and the storyboard's presence check fails when its hold misses the travel, as architecture:component-test-sufficiency INV6 asks. The diff also contains #10286's commit, so this pull request lands with or after #10286.

[Automated review]

Two tests held the switch's travel once the test had seen it run. On a
loaded runner the travel had often ended by then, so the hold caught
it at rest. Both now arm armHold before the action. The tap's
storyboard holds at a count of 3: the press starts two animations, and
the release starts its travel with several others at once.
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 25979cd

@astracat-bot astracat-bot Bot 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.

Approved pending CI: CI has not run on this head yet, because the pull request is a draft. It already carries the ci:run label, so marking it ready for review starts CI.

Both Switch tests now arm armHold before their action and name the thumb's translate as the judged motion, as architecture:component-test-sufficiency INV6 asks, so a hold that misses the travel fails instead of sampling or filming the wrong motion.

One small description fix: the last Change bullet says both tests drop thumb, but the tap storyboard keeps it to name the judged motion.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 7, 2026 05:12
@cixzhang
cixzhang merged commit 4f889da into meta:main Nov 7, 2026
122 checks passed
@vjeux
vjeux deleted the hold-switch branch November 7, 2026 05:48

This branch was successfully deployed

1 active deployment
Preview — 25979cdd Deployed Nov 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants