Skip to content

test: replace sleeps with barriers and isolate shared test state - #3421

Merged
datlechin merged 1 commit into
refactor/test-systemfrom
refactor/test-hygiene
Oct 14, 2026
Merged

datlechin merged 1 commit into
refactor/test-systemfrom
refactor/test-hygiene

Conversation

@datlechin

Copy link
Copy Markdown
Member

Why

  • Unit tests waited on wall time (fixed sleeps, run-loop spins, debounce waits), shared global state behind .serialized, and leaked defaults suites into ~/Library/Preferences.
  • The UI suite cut in test: rewrite the test suite, test plans and CI #3412 left 69 flows to prove at the unit level.

Change

  • Waits use barriers, an injected clock or a shared waitUntil that fails on timeout. Each new barrier was checked with a mutation.
  • Shared state runs under GlobalStateSuites or a trait; EphemeralDefaults replaces ad-hoc suites. 165 XCTest files move to Swift Testing; single-literal case groups become parameterized tests.
  • The cut UI flows are covered by 13 new unit tests and 48 existing ones.
  • The unit host no longer fetches the real plugin registry or writes AppKit split-view keys to com.TablePro. SwiftLint now flags a UserDefaults = .standard default argument.

Verified

  • Unit plan: 24,197 cases, 0 failures; wall time 258 s to 193 s. Preferences file count, com.TablePro keys and the plist mtime are unchanged around a full run.

Not in this PR

  • Stacked on test: run plugin and UI-free app tests hostless in packages #3418; rebased onto main once that lands.
  • No unit seam without a view refactor, so no test: Compare Sync's license explanation, the tag menu's create item, the unlicensed chart, What's New opening its window.
  • TableProTests stays serial: with in-process parallelism on, main-actor work queued past the 60 s limit. Stage 5 measures the other options.

@datlechin
datlechin added this pull request to stack #3422 October 14, 2026 16:38
@datlechin
datlechin marked this pull request as ready for review October 14, 2026 16:38
@datlechin
datlechin removed this pull request from stack #3422 October 14, 2026 16:38
@datlechin
datlechin merged commit 67c0c01 into refactor/test-system Oct 14, 2026
6 of 7 checks passed
@datlechin
datlechin deleted the refactor/test-hygiene branch October 14, 2026 16:38
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