codeburn/mac/Tests/CodeBurnMenubarTests
ozymandiashh 714e1b3a70 test(menubar): make ServeConnection cancellation tests deterministic under load
Three ServeConnectionTests failed on roughly half of all macOS Menubar CI
runs and always passed on re-run. Each one raced a real clock or a real
child process against Swift-side work. A cooperative pool starved by
CPU-heavy suites that swift-testing schedules alongside can delay that work
by seconds.

- "cancelling a hung request returns promptly" asserted a 500 ms wall-clock
  budget, and its fixture child exited after `sleep 1`. When the cancellation
  hop was starved past those exits, the connection retried the request on
  replacement children until the death budget answered ServeUnavailable. The
  timeout path never fired, because the test used the real ten-minute budget.
  The child now stays alive, the timeout comes from the manual clock, and the
  test asserts that the caller sees CancellationError before any timeout fires.
- "a request queued during cancelled hydration completes on the same child"
  read the child's event log as soon as the reply resumed the caller, but the
  child appends "second-replied" only after writing that reply. The test now
  waits for the log line. The manual clock also replaces its timeout recorder,
  which really fired after 5 s.
- "external cancellations keep one child and safely discard late replies" let
  the fixture reply 50 ms after reading, so a delayed cancel lost to the reply.
  The child now holds each reply until the test has observed the cancellation.

Polling is bounded by a 30 s hang guard instead of 2 s. When a guarded await
expires, the guard releases the fixture, so a regression fails its assertions
instead of hanging the run. No production code changes.

Closes #1333
2026-09-13 06:52:39 +03:00
..
AgentTabProviderVisibilityTests.swift fix(menubar,app): absent hasUsage hid every provider with no period spend 2026-09-02 07:32:02 -07:00
AntigravityQuotaPresentationTests.swift feat(menubar): live Antigravity quota — local language-server probe, Settings pane, Plan tab 2026-08-24 09:40:04 -07:00
AntigravityQuotaTests.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
AppStoreCopilotDisconnectTests.swift fix(mac): preserve explicit Copilot disconnect across refreshes 2026-09-09 16:17:15 +05:30
AppStoreRefreshConcurrencyTests.swift fix(menubar): a twice-contradicting scoped payload threw instead of being served 2026-09-02 07:54:55 -07:00
AppStoreRefreshRecoveryTests.swift fix(menubar): the selection fallback showed another provider's totals under the selected tab 2026-09-02 07:55:43 -07:00
AppVersionTests.swift Normalize menubar version display 2026-05-11 11:21:39 -07:00
CapacityDockConnectionActionTests.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
CapacityDockGlanceTests.swift fix(menubar): stop the dock resizing and claiming a refresh it is not doing 2026-09-12 12:19:29 -07:00
CapacityDockGlanceWindowTests.swift feat(menubar): switch the Capacity Dock gauge between usage windows 2026-09-12 06:38:34 -07:00
CapacityDockInteractionStateTests.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
CapacityDockMotionTests.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
CapacityDockPacePresentationTests.swift fix(menubar): stop the dock resizing and claiming a refresh it is not doing 2026-09-12 12:19:29 -07:00
CapacityDockPlacementTests.swift fix(menubar): keep Capacity Dock hover alive after app deactivation (#1170) 2026-08-29 18:42:27 +02:00
CapacityDockPointerUpdateCoalescerTests.swift Fix Capacity Dock pointer coalescing and dismissal 2026-09-01 16:51:00 +05:30
CapacityDockPreferencesTests.swift feat(menubar): switch the Capacity Dock gauge between usage windows 2026-09-12 06:38:34 -07:00
CapacityDockPresentationTests.swift Merge main into fix/dock-detail-integral-height 2026-09-03 06:36:15 -07:00
CapacityDockProviderQuotaServiceTests.swift feat(mac): add native Grok Build provider 2026-09-01 18:46:02 +05:30
CapacityDockTodayTests.swift Add cache-read usage and quota pace to Capacity Dock 2026-09-07 05:22:35 +03:00
CapacityEstimatorTests.swift feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
ClaudeRateLimitTests.swift menubar: honor Retry-After on Claude quota 429s, back off failed refreshes (#702) 2026-07-16 14:52:47 -07:00
ClaudeSubscriptionParsingTests.swift fix(menubar): provider-correct plan tab copy; surface model-scoped weekly limits 2026-07-02 19:37:51 +02:00
CLIDevinConfigTests.swift feat: add devin provider (#444) 2026-06-09 21:58:31 +02:00
ClinePassQuotaTests.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
CLIWatchdogTests.swift fix(menubar): no-output watchdog, lock signal cleanup, dead-pid takeover, serve orphan reaping 2026-08-23 05:35:17 -07:00
CodeBurnCacheDirectoryTests.swift perf(desktop): share cache state and eliminate duplicate cold hydration 2026-08-12 17:16:41 +03:00
CodeburnCLIPathTests.swift fix(mac): prefer the node beside the CLI over a version manager's default 2026-09-07 10:16:48 +08:00
CodexBankedResetTests.swift feat(codex): notify once when OpenAI banks a limit reset 2026-09-12 14:37:24 -07:00
CodexPlanParsingTests.swift feat(codex): show the credit limit on credit-metered ChatGPT workspaces 2026-07-27 08:19:59 -04:00
CodexQuotaSummaryTests.swift fix(codex): align credit/dollar footer formatting across desktop and menubar 2026-08-01 22:32:53 +02:00
CodexResetCreditsTests.swift feat(codex): read the per-credit fields the reset-credits payload already carries 2026-09-12 14:37:24 -07:00
CodexTerminalFailureTests.swift test(menubar): lock in Codex terminal-failure classification 2026-05-30 12:32:19 -07:00
ContributionHeatmapTests.swift fix(menubar-tests): add missing localModelSavings/savingsUSD args so swift tests compile (#465) 2026-06-09 21:56:13 +02:00
CopilotHostEndpointTests.swift fix(menubar): give the pasted Copilot token a GitHub host of its own 2026-09-12 12:02:13 -07:00
CopilotQuotaPresentationTests.swift fix(menubar): follow the credential's GitHub host for Copilot quota 2026-09-12 05:56:05 -07:00
CopilotQuotaTests.swift fix(menubar): give the pasted Copilot token a GitHub host of its own 2026-09-12 12:02:13 -07:00
CredentialKeychainCacheRedTests.swift fix(menubar): migrate Claude/Codex caches to namespaced Keychain 2026-08-19 15:21:28 +05:30
CredentialKeychainContinuityTests.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
CursorQuotaTests.swift fix(menubar): harden the Cursor quota adapter 2026-08-29 14:17:15 -07:00
DataClientProcessTests.swift fix(menubar): no-output watchdog, lock signal cleanup, dead-pid takeover, serve orphan reaping 2026-08-23 05:35:17 -07:00
EarlyQuotaResetTests.swift fix(mac): fold the three notification switches into one section 2026-09-12 14:59:58 -07:00
GeminiQuotaTests.swift test(menubar): align Gemini retired-tier expectation with the em-dash-free message 2026-08-24 10:08:33 -07:00
GrokBuildSubscriptionServiceTests.swift fix(mac): treat omitted Grok credit percent as 0% in an active window 2026-09-02 15:06:17 -07:00
KimiQuotaPresentationTests.swift fix(menubar): keep showing Kimi quota when the login is idle, stamp stale data 2026-07-26 06:35:13 -07:00
KimiUsageParsingTests.swift menubar: add Kimi Code subscription quota tracking 2026-07-23 21:31:55 +02:00
LanguagePreferenceTests.swift feat(menubar): add a language picker to Settings 2026-09-12 16:12:11 -07:00
LiveKeychainCredentialCacheTests.swift fix(menubar): never let a Keychain read raise UI on the refresh timer 2026-08-19 11:43:22 -07:00
LocalizationCatalogTests.swift test(menubar): assert the en and zh-Hans catalogs cannot drift apart 2026-09-12 15:22:03 -07:00
LocalizationCoverageTests.swift test(menubar): let the scanner see tooltips and notification titles 2026-09-12 16:12:11 -07:00
LocalizationSourceScanner.swift test(menubar): let the scanner see tooltips and notification titles 2026-09-12 16:12:11 -07:00
MenubarPayloadCombinedTests.swift fix(usage): preserve project identity and qualify incomplete session counts 2026-09-07 22:02:54 +05:30
MenubarPeriodSettingsTests.swift fix(clients): display CLI-computed values verbatim, align period windows across app/dash/menubar 2026-07-20 06:26:15 -07:00
MenubarSecondRowTests.swift fix(menubar): budget the second row by the width it draws 2026-09-12 16:12:11 -07:00
MenubarStatusCacheTests.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
ProviderConnectionCatalogTests.swift feat(mac): add native Grok Build provider 2026-09-01 18:46:02 +05:30
ProviderIconTests.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
ProviderReconnectPresentationTests.swift fix menubar provider usage contracts 2026-09-02 16:17:28 +05:30
ProviderSettingsEditorStateTests.swift fix(mac): document the main-queue serialization and harden the deadlock test cleanup 2026-09-01 04:58:16 -07:00
ProviderStripPagingStateTests.swift harden provider period and cache contracts 2026-09-02 16:18:05 +05:30
QuotaFreshnessTests.swift fix(menubar): stop the dock resizing and claiming a refresh it is not doing 2026-09-12 12:19:29 -07:00
QuotaPaceTests.swift menubar: linear pace on Codex quota windows — deficit/reserve, projection, run-out ETA (#726) (#728) 2026-07-20 05:21:43 -07:00
QuotaRefreshDecisionTests.swift fix(mac): keep dock quota fresh when the payload tick is skipped 2026-09-12 03:47:46 -07:00
QuotaSummaryHeadlineTests.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
RefreshCadenceTests.swift menubar: skip unchanged background refreshes, 120s AC idle cadence, utility QoS for tick spawns (#703) (#704) 2026-07-16 15:11:25 -07:00
ServeConnectionTests.swift test(menubar): make ServeConnection cancellation tests deterministic under load 2026-09-13 06:52:39 +03:00
SessionCountLabelTests.swift fix(usage): fold Windows case in spend identity, qualify --json counts, drop scratch tests 2026-09-07 14:56:32 -07:00
StatusItemContextMenuPolicyTests.swift test(mac): lock status-item context menu policy (#802) 2026-07-24 19:27:25 +07:00
StatusItemPlacementPolicyTests.swift fix(menubar): recover parked status item (#1161) 2026-08-28 13:20:48 -07:00
TerminalLauncherTests.swift feat(menubar): add preferred terminal setting with Terminal.app fallback 2026-08-04 00:19:00 +03:00
UpdateCheckerTests.swift fix(menubar): clarify update failure status 2026-07-26 15:20:13 +08:00
UpdateNotificationTests.swift feat(mac): notify when an update is available 2026-09-10 12:39:38 -07:00
UsageDataChangeGuardTests.swift menubar: skip unchanged background refreshes, 120s AC idle cadence, utility QoS for tick spawns (#703) (#704) 2026-07-16 15:11:25 -07:00
ZaiQuotaTests.swift fix(mac): map Z.ai body auth errors 2026-08-31 13:51:46 -03:00