Skip to content

Stabilize Apple simulator test runs - #276

Merged
rajzik merged 1 commit into
mainfrom
codex/fix-attachment-eviction-test-instability
Aug 4, 2026
Merged

rajzik merged 1 commit into
mainfrom
codex/fix-attachment-eviction-test-instability

Conversation

@gipity-bot

@gipity-bot gipity-bot Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • run the app-hosted XCTest bundle serially, matching CI and avoiding unreliable parallel Simulator clones
  • isolate attachment-eviction notifications and wait for both asynchronous events before test teardown
  • keep the Gmail generation-gate test on its recording connection service instead of the real Keychain-backed service
  • attach UIKit performance-test windows to the active UIWindowScene

Root cause

Parallel execution launched several complete app-hosted Simulator clones. Once one test process crashed or stalled, SpringBoard and RunningBoard denied later app launches as busy. Three independent test-fixture problems amplified that failure cascade: an eviction notification escaped into the next test iteration, a generation-gate test entered the real credential service before reaching its intended rendezvous, and detached UIKit windows never produced SwiftUI row lifecycle callbacks.

Impact

The documented local Apple test command now follows the stable serial behavior already used by CI. Runtime attachment notifications still use NotificationCenter.default; the injected center is an internal test seam.

Validation

  • attachment-store class stress harness: 1,020/1,020 passed
  • Gmail generation-gate test: 20/20 iterations passed
  • release-budget performance test passed within every existing threshold
  • mise exec -- zsh scripts/check-apple-lint.zsh
  • mise exec -- xcodebuild test -project apps/unwired-mail/unwired-mail.xcodeproj -scheme unwired-mail -destination 'platform=iOS Simulator,name=iPhone 17' — 1,450 passed, 0 failed
  • git diff --check

No documentation or changeset is required because the documented command and product behavior are unchanged.

Related to #275.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e1d3fdc7-bc05-4382-9d88-f2af9e5dee43

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Summary

  • Configured the Apple unwired-mail test target to run app-hosted XCTest bundles serially.
  • Isolated attachment-eviction notifications with an injected NotificationCenter.
  • Updated attachment tests to wait for both asynchronous eviction events before teardown.
  • Kept the Gmail generation-gate test on its recording connection service.
  • Updated UIKit performance-test fixtures to use the active UIWindowScene.
  • No user-visible, privacy, security, migration, or TypeScript changes.

Validation

  • Stress, generation-gate, performance, lint, full Apple test, and diff checks passed.
  • 1,450 tests passed.
  • No tests failed.

Walkthrough

The changes isolate attachment eviction notifications with dependency injection and update mailbox adapter tests to create windows from connected scenes. The shared Xcode scheme disables test parallelization.

Changes

Test isolation and scene-aware fixtures

Layer / File(s) Summary
Attachment eviction notification isolation
apps/unwired-mail/unwired-mail/Features/Account/MessageAttachmentDownload.swift, apps/unwired-mail/unwired-mailTests/SettingsDestinationRegistryTests.swift
DownloadedAttachmentStore uses an injected NotificationCenter. The eviction test observes both eviction notifications.
Scene-aware mailbox adapter test fixtures
apps/unwired-mail/unwired-mailTests/MailboxConnectionAdapterTests.swift, apps/unwired-mail/unwired-mail.xcodeproj/xcshareddata/xcschemes/unwired-mail.xcscheme
Mailbox adapter tests use throwing, scene-based fixture windows and an explicit connection service. The shared test scheme disables parallel execution.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the primary change: stabilizing Apple simulator test runs.
Description check ✅ Passed The description directly explains the simulator, notification, fixture, validation, and test-stability changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-attachment-eviction-test-instability

Comment @coderabbitai help to get the list of available commands.

@gipity-bot

gipity-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@rajzik
rajzik marked this pull request as ready for review August 4, 2026 08:37
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@rajzik
rajzik merged commit 48b344c into main Aug 4, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant