Skip to content

Fix clock-dependent command palette ordering fixtures - #6472

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-command-palette-fixture-time
Oct 28, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-command-palette-fixture-time

Conversation

@ymichael

@ymichael ymichael commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Two command-palette fixtures expected six threads to sort by index but calculated each row's updatedAt using a fresh Date.now() - index. If the clock advances 2ms before the final row, row 5 becomes newer than row 4. The production comparator correctly reorders them, violating the fixture's intended input and producing the Fix 4/Fix 5 reversal in CI 40754458406, attempt 1.

What changed

Capture one base timestamp per fixture and derive every row's read/update timestamps from it. Both full test bodies, interactions and assertions remain intact. Only one test file changes; no production code, timers, timeouts, retries or CI configuration changes.

How you verified

  • Temporarily advanced Date.now() by 2ms between fixture rows 4 and 5, then restored the real clock before rendering. On baseline, the full file had exactly two failures: the observed Fix 4/Fix 5 reversal and the neighboring highlighted-row assertion. With this change, all 71 tests pass under the same diagnostic. Diagnostic instrumentation was removed afterward.
  • Normal pnpm exec turbo run test --filter=@bb/app -- src/components/commands/CommandPalette.test.tsx src/lib/command-palette/palette-thread-search.test.ts: all 100 tests pass.
  • pnpm exec turbo run lint typecheck --filter=@bb/app passes (existing lint warnings, zero errors).
  • Independent diff review found no correctness issues.
  • CI 40761448206 passed at final head 49f67b1d3a, without a rerun. The existing UI-only selection policy skips Windows jobs for this change.

AGENT GENERATED

@ymichael
ymichael merged commit 69680a7 into main Oct 28, 2026
32 checks passed
@ymichael
ymichael deleted the bb/fix-command-palette-fixture-time branch October 28, 2026 20:20
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