Skip to content

test(desktop): fix workhub fold gutter flake - #5393

Merged
Astro-Han merged 1 commit into
apache:mainfrom
orangeCatDeveloper:test/workhub-layout-motion-settle
Sep 16, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
orangeCatDeveloper:test/workhub-layout-motion-settle

Conversation

@orangeCatDeveloper

@orangeCatDeveloper orangeCatDeveloper commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Flaky test: workhub-layout.spec.ts failed on main in https://github.com/apache/maka/actions/runs/35075202726 (Expected: 12, Received: 11.984375) right after Desktop e2e moved to 3 parallel workers.

The sampling window keeps its job for the motion assertions; the resting position and inset are now polled instead of read from the last sampled frame.

Root cause

The test clicked the fold button, sampled getBoundingClientRect for a fixed 500ms of animation frames, and asserted the last frame sat at the 12px gutter. The dock padding is driven by element.animate() with a 420ms cubic-bezier(0.22, 1, 0.36, 1) (workhub-root.tsx, dockMotion). That animation is play-pending until the next frame resolves its start time, and with three e2e workers sharing 4 vCPUs the next frame can land 100ms+ after the click. The easing is strongly ease-out, so its last ~90ms move the padding by less than 1/64px per frame, which is below layout precision: the window closes with the padding at 11.98 instead of 12. The same tail shows up at 0.02 on the collapse direction.

Verification

Local repro with Emulation.setCPUThrottlingRate at 10x on the WorkHub renderer, this test only, 8 repeats:

before:
  8 failed
  Expected: 12
  Received: 11.9921875
    at e2e/workhub-layout.spec.ts:329:35

after:
  8 passed (1.8m)

Unthrottled full spec under CPU load: 24 passed.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code diagnosed the easing-tail race, wrote the fix and ran the throttled repro.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Sep 16, 2026
The fold sampler read the final gutter from a fixed 500ms window, but a
loaded runner starts the 420ms dock animation late enough that the last
frame is still in the easing tail (11.98 instead of 12).

Generated-by: Claude Code
@orangeCatDeveloper
orangeCatDeveloper force-pushed the test/workhub-layout-motion-settle branch from d439570 to 29aadf2 Compare September 16, 2026 09:57
@orangeCatDeveloper orangeCatDeveloper changed the title test(desktop): poll the composer resting position test(desktop): fix workhub fold gutter flake Sep 16, 2026

@Astro-Han Astro-Han 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.

LGTM

@Astro-Han
Astro-Han merged commit a4700a7 into apache:main Sep 16, 2026
1 check passed
@orangeCatDeveloper
orangeCatDeveloper deleted the test/workhub-layout-motion-settle branch September 16, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants