Skip to content

test: stabilize Windows CI suites - #885

Merged
benvinegar merged 2 commits into
mainfrom
fix/windows-ci-flakes
Aug 27, 2026
Merged

benvinegar merged 2 commits into
mainfrom
fix/windows-ci-flakes

Conversation

@benvinegar

@benvinegar benvinegar commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • replace wall-clock sleeps in scrollbar auto-hide tests with a deterministic scheduler
  • prevent canceled scrollbar timers from hiding a newer visibility window
  • verify drag release starts a fresh auto-hide window
  • give the two compiled portability control builds a bounded 15-second setup timeout
  • give the real Git subprocess suites a bounded 30-second per-test timeout

Problem

The Windows compatibility job has repeatedly failed the scrollbar auto-hide assertion even after widening its timer margins. Hosted Windows runners can oversleep those real-time boundaries enough to invert the assertion.

A separate Windows prebuilt job also killed the second compiled control at Bun's default five-second beforeAll deadline. The compiler emitted no error; the hook timed out while two cold builds ran sequentially.

Repeated Windows validation also exposed the same five-second default in the loader and Git-command integration suites: on a slower hosted runner, nine otherwise-successful real-Git tests crossed the deadline. Those suites now use the same bounded timeout policy already used by the Git adapter integration tests.

Testing

  • bun test --rerun-each=20 src/ui/components/scrollbar/VerticalScrollbar.test.tsx
  • bun test src/core/changeset/loaders.test.ts
  • bun test src/extensions/default/vcs/git/commands.test.ts
  • bun run build:bin
  • HUNK_TEST_EXECUTABLE="$PWD/dist/hunk" bun test test/cli/compiled-headless-native-lib.test.ts
  • bun run test:integration
  • bun run test:theme-contrast
  • bun run typecheck
  • bun run format:check
  • bun run lint
  • bun run deps:check

bun run test reaches one unrelated local-environment failure in src/extensions/hostRuntimeModules.test.ts: this machine has a globally resolvable /home/bentlegen/node_modules/react, while that test requires an outsider module not to resolve React. The same focused failure reproduces from a clean origin/main worktree under Bun 1.3.14; the remaining source tests pass.

Tested locally on Linux and through repeated Windows GitHub Actions jobs. No visual evidence is included because production rendering and interaction behavior are unchanged.

This PR description was generated by Pi using GPT-5.6 Sol

@vercel

vercel Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hunk-web Ignored Ignored Preview Aug 27, 2026 3:09pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces wall-clock waits in scrollbar tests with deterministic scheduling, guards newer visibility windows against canceled callbacks, and extends the compiled portability setup deadline.

  • Adds an injectable scrollbar scheduler and generation-based stale-callback protection.
  • Expands deterministic coverage for repeated activity and drag-release auto-hide behavior.
  • Gives compiled portability control setup a bounded 15-second timeout.

Confidence Score: 4/5

The PR appears safe to merge, with only non-blocking documentation needed for two new test-scheduler methods.

The production timer lifecycle safely invalidates stale callbacks and preserves scheduler ownership, while the sole accepted issue is missing required TSDoc on test utility methods.

Files Needing Attention: src/ui/components/scrollbar/VerticalScrollbar.test.tsx

Important Files Changed

Filename Overview
src/ui/components/scrollbar/VerticalScrollbar.tsx Introduces scheduler injection and generation-guarded timer ownership while preserving production use of native timers.
src/ui/components/scrollbar/VerticalScrollbar.test.tsx Replaces timing-sensitive sleeps with a deterministic scheduler; two new scheduler methods lack required TSDoc explanations.
test/cli/compiled-headless-native-lib.test.ts Extracts the compiled-control setup and assigns the hook a 15-second timeout without changing setup or cleanup logic.
.changeset/fix-windows-ci-flakes.md Adds an empty maintenance Changeset appropriate for non-user-facing CI stabilization.
Prompt To Fix All With AI
### Issue 1
src/ui/components/scrollbar/VerticalScrollbar.test.tsx:146
**Scheduler methods lack TSDoc**

The new `setTimeout` and `clearTimeout` methods lack the required short TSDoc explanations, leaving their timer registration and cancellation semantics harder to understand and safely modify.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "test: stabilize Windows CI timers" | Re-trigger Greptile

/** Provides deterministic scrollbar timer control without replacing renderer timers. */
class TestScrollbarScheduler implements VerticalScrollbarScheduler {
readonly cleared: number[] = [];
readonly tasks = new Map<number, ScheduledTask>();

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.

P2 Scheduler methods lack TSDoc

The new setTimeout and clearTimeout methods lack the required short TSDoc explanations, leaving their timer registration and cancellation semantics harder to understand and safely modify.

Context Used: guidelines.mdc Cursor rule (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ui/components/scrollbar/VerticalScrollbar.test.tsx
Line: 146

Comment:
**Scheduler methods lack TSDoc**

The new `setTimeout` and `clearTimeout` methods lack the required short TSDoc explanations, leaving their timer registration and cancellation semantics harder to understand and safely modify.

**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@benvinegar benvinegar changed the title test: stabilize Windows CI timers test: stabilize Windows CI suites Aug 27, 2026
@benvinegar
benvinegar merged commit 506bffa into main Aug 27, 2026
24 checks passed
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.

1 participant