Skip to content

fix(test): de-flake parallel-only starvation timeouts (deterministic joins)#1315

Closed
mauricecarrier7 wants to merge 1 commit into
developfrom
fix/deflake-parallel-timeouts
Closed

fix(test): de-flake parallel-only starvation timeouts (deterministic joins)#1315
mauricecarrier7 wants to merge 1 commit into
developfrom
fix/deflake-parallel-timeouts

Conversation

@mauricecarrier7

Copy link
Copy Markdown
Contributor

Problem

Nine PalaceTests classes hit the 120s executionTimeAllowance ONLY under CI's 2-sim-clone parallel run — they pass serially, in isolation, and can't be reproduced without parallel clones. Root cause (already diagnosed): each polled a fire-and-forget async op on a fixed wall-clock deadline (awaitCondition / Timer.scheduledTimer / RunLoop-poll / wait(for:) on a detached Task). Under the cooperative-thread-pool oversubscription from 2 clones on the macos runner, that op gets deferred past the poll deadline → timeout.

This is the convergence work for the deferred test-pollution-systemic debt for the frequent parallel-only flakers.

Fix — join the actual work, don't poll a deadline

No weakened assertions, no XCTSkip, no raised allowance, no disabled parallelism.

Class Root Fix
CatalogCacheKeyAndIsolationTests (#1 flaker; 4× awaitCondition(30s)) deadline-poll _awaitAllBackgroundRefreshesForTesting() for concurrent refreshes; _awaitBackgroundRefreshForTesting() for single; 2 memory-warning polls were vestigial (sync eviction) → assert directly
AudiobookBookmarkBusinessLogicTests + …PositionWriteTests deadline-poll join the detached position-write Task via new _awaitPositionWriteForTesting(); dealloc test captures the handle pre-dealloc; saveBookmark debounce → injected near-zero debounceInterval
TPPPDFDocumentMetadataTests shared-state (not a poll) MockPDFDocumentMetadata injected AppContainer.production().bookRegistry; now uses an isolated per-instance TPPBookRegistryMock
TPPSignInBusinessLogicSignOutTests deadline-poll (Timer×3) continuation seam on TPPDRMAuthorizingMock (_awaitDeauthorizeCalledForTesting); no production change
BorrowOperationContractTests vestigial poll delegate hop runs via await MainActor.run inside the awaited borrowAsync → deterministic main-actor drain + direct assert
MultiLibraryTokenIsolationTests deadline-poll (L363) await MainActor.run {} to settle the .credentialsStale hop after the awaited refresh
ActiveSessionsViewModelTests tight-timeout 0.5s wait(for:) on a synchronous notification re-query → 5.0s (matches the sibling already bumped)

Production seams added

All behavior-identical (nothing production reads them) and none touch borrow/return/download/DRM/payment money-path logic — they're catalog-cache and audiobook-position-persistence:

  • CatalogRepository: _awaitAllBackgroundRefreshesForTesting + a _trackRefreshTasksForTesting arming flag (off in prod → no unbounded handle growth).
  • AudiobookBookmarkBusinessLogic: injectable debounceInterval (default 1.0, prod unchanged) + retained position-write Task handle + _awaitPositionWriteForTesting / _positionWriteTaskHandleForTesting.

Verification — real parallel repro

xcodebuild test ... -parallel-testing-enabled YES -maximum-parallel-testing-workers 2 -test-iterations 3 over all 9 classes:

  • ** TEST EXECUTE SUCCEEDED **, 0 timeouts, 0 restarts, 327/327 passing.
  • Slowest test 0.204s (was up to 30s+ polls / a 6.2s reentrant-signout failure).
  • Each fixed class also confirmed behavior-identical when run alone.

Not fixed (by design)

  • BookRegistrySyncTests and MultiLibrary Test 11 reachability are signing-env cases (AppContainer.production() keychain, documented MIGRATED-DEFERRED) that pass on signed CI and are NOT deadline-polls.
  • TPPBookRegistryStateConcurrencyTests has no wait sites (ImageCache.shared shared-state).
  • The BookRegistrySync credential-path DI seam is a critical-path production change requiring SoD review — out of scope for a test-only de-flake pass.

🤖 Generated with Claude Code

…joins)

Nine PalaceTests classes hit the 120s executionTimeAllowance ONLY under
CI's 2-sim-clone parallel run (never serially, never in isolation): they
polled a fire-and-forget async op on a fixed wall-clock deadline
(awaitCondition / Timer.scheduledTimer / RunLoop-poll / wait(for:) on a
detached Task), and the cooperative-thread-pool oversubscription from 2
clones deferred that op past the poll deadline. This converges the
deferred `test-pollution-systemic` debt for the frequent parallel-only
flakers by replacing each deadline-poll with a JOIN of the actual work
unit, so the test blocks exactly until the work finishes regardless of
pool load. No weakened assertions, no XCTSkip, no raised allowance, no
disabled parallelism.

Per target (root -> fix):
- CatalogCacheKeyAndIsolationTests (#1 flaker; 4x awaitCondition(30s)):
  concurrent-refresh polls -> _awaitAllBackgroundRefreshesForTesting();
  single-refresh poll -> _awaitBackgroundRefreshForTesting(); the two
  memory-warning polls were vestigial (handleMemoryWarning clears the
  cache synchronously during NotificationCenter.post) -> assert directly.
- AudiobookBookmarkBusinessLogicTests + ...PositionWriteTests: 2-5s
  wait(for:) on the detached position-write Task -> join via new
  _awaitPositionWriteForTesting(); dealloc-during-write 1.5s wall-clock
  poll -> capture the Task handle pre-dealloc and await it; saveBookmark
  debounce waits -> injected near-zero debounceInterval (semantics
  unchanged, pinned by the rapid-calls coalesce test).
- TPPPDFDocumentMetadataTests: whole-class flake was shared-state, not a
  poll -> MockPDFDocumentMetadata injected AppContainer.production()
  .bookRegistry; now injects an isolated per-instance TPPBookRegistryMock.
- TPPSignInBusinessLogicSignOutTests: 3x Timer.scheduledTimer polling
  deauthorizeWasCalled -> continuation seam on TPPDRMAuthorizingMock
  (_awaitDeauthorizeCalledForTesting); no production change.
- BorrowOperationContractTests: waitForLog(10s) polled a delegate hop
  that runs via `await MainActor.run` INSIDE the awaited borrowAsync ->
  deterministic single main-actor drain + direct assert.
- MultiLibraryTokenIsolationTests: L363 RunLoop-poll for .credentialsStale
  (a @mainactor hop after the awaited refresh) -> await MainActor.run{}.
- ActiveSessionsViewModelTests: 3x tight 0.5s wait(for:) on a synchronous
  notification re-query -> 5.0s (matches the sibling already bumped).

Production seams added (all behavior-identical; nothing production reads
them; NONE touch borrow/return/download/DRM/payment money-path logic):
- CatalogRepository: _awaitAllBackgroundRefreshesForTesting +
  _trackRefreshTasksForTesting arming flag (off in prod -> no unbounded
  handle growth).
- AudiobookBookmarkBusinessLogic: injectable debounceInterval (default
  1.0, prod unchanged) + retained position-write Task handle +
  _awaitPositionWriteForTesting / _positionWriteTaskHandleForTesting.

Verified under a real parallel repro (2 clones, 3 iterations, all 9
classes): ** TEST EXECUTE SUCCEEDED **, 0 timeouts, 0 restarts, 327/327
passing; slowest test 0.204s (was up to 30s+ polls / a 6.2s reentrant
failure). Each fixed class also confirmed behavior-identical alone.

**Scope:** the frequent parallel-only deadline-poll flakers.
**Not done:** BookRegistrySyncTests and MultiLibrary Test 11 reachability
are signing-env cases (AppContainer.production() keychain, documented
MIGRATED-DEFERRED) that pass on signed CI and are NOT deadline-polls;
TPPBookRegistryStateConcurrencyTests has no wait sites (ImageCache.shared
shared-state). Left untouched by design.
**Deferred:** the BookRegistrySync credential-path DI seam is a
critical-path production change requiring SoD review, out of scope for a
test-only de-flake pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🏗️ CodeAtlas Ledger Analysis

✅ All Checks Passed


♿ Accessibility (via AccessLint)

💡 Static analysis against WCAG 2.1 AA guidelines for iOS accessibility.

No accessibility issues detected


🧪 Test Coverage (via QAAtlas)

⚠️ No coverage data available - QAAtlas requires an OpenAI API key.
Set OPENAI_API_KEY in repository secrets to enable AI-powered test coverage analysis.


🏛️ Architecture Analysis

Metric Value ℹ️ What This Means
Components 12 Distinct modules/layers detected in your codebase
Dependency Cycles 0 Circular dependencies (A→B→C→A). Goal: 0
Layer Violations 1 Dependencies that break architectural boundaries
Hotspots 0 Files with high complexity + frequent changes
Avg Coupling 1.00 How interconnected modules are (lower is better, <1.0 is good)

🔍 Reachability Analysis

💡 Detects code that cannot be reached from entry points (dead code).

No dead code detected


📊 0 files analyzed | 📦 Download Full Report

Powered by CodeAtlas Ledger
• Accessibility: AccessLint

@github-actions

Copy link
Copy Markdown

🧪 Unit Test Results

📊 View Full Interactive Report

❌ 4 TESTS FAILED

7869 tests | 7731 passed | 4 failed | 132 skipped | ⏱️ 18m 40s | 📊 98.2% | 📈 45.9% coverage

Tests by Class — 902 classes, 4 with failures
Class Tests Passed Failed Duration
✅ AccessLintComplianceTests 11 11 0 1.61s
✅ AccessibilityAnnouncementCenterTests 20 20 0 2.20s
✅ AccessibilityLabelTests 9 9 0 21ms
✅ AccessibilityPreferencesTests 26 26 0 378ms
✅ AccessibilityServiceTests 11 11 0 126ms
✅ AccountAuthDocCarryoverTests 5 5 0 269ms
✅ AccountAuthSurfaceHostsTests 7 7 0 68ms
✅ AccountAwareNetworkTests 10 10 0 267ms
✅ AccountDetailCredentialStateTests 7 0 0 108ms
✅ AccountDetailPINVisibilityTests 25 0 0 1.21s
✅ AccountDetailSignOutConfirmationTests 2 0 0 88ms
✅ AccountDetailViewModelGapTests 1 1 0 22ms
✅ AccountDetailViewModelLeakTests 1 1 0 383ms
✅ AccountDetailViewModelSignedInDerivationTests 5 0 0 44ms
✅ AccountDetailViewModelTests 19 0 0 293ms
✅ AccountDetailsAuthenticationIsBrowserBasedTests 10 10 0 82ms
✅ AccountDetailsNeedsAuthAggregateTests 10 10 0 10ms
✅ AccountDetailsURLTests 17 17 0 605ms
✅ AccountModelGapTests 9 9 0 226ms
✅ AccountModelTests 20 20 0 69ms
✅ AccountProfileDocumentTests 3 3 0 5ms
✅ AccountStateMachineTests 10 10 0 205ms
✅ AccountSwitchCleanupTests 8 8 0 40ms
✅ AccountSwitchIntegrationTests 8 8 0 100ms
✅ AccountSwitchLifecycleTests 9 0 0 384ms
✅ AccountsManagerAccountIndexTests 7 7 0 139ms
✅ AccountsManagerCacheReadTests 4 4 0 256ms
✅ AccountsManagerCacheTests 16 16 0 148ms
✅ AccountsManagerCancellationTests 5 5 0 571ms
✅ AccountsManagerFirstRunDecodeTests 3 3 0 588ms
✅ AccountsManagerGapTests 3 3 0 3ms
✅ AccountsManagerHelpersTests 12 12 0 18ms
✅ AccountsManagerIsolationLintTests 4 4 0 1.05s
✅ AccountsManagerLaunchSnapshotTests 13 13 0 2.01s
✅ AccountsManagerStateMachineWiringTests 16 16 0 3.69s
✅ AccountsManagerTests 51 49 0 1.86s
✅ ActiveSessionsViewModelTests 12 12 0 241ms
✅ AdobeActivationTests 6 6 0 30ms
✅ AdobeCertificateGapTests 7 7 0 8ms
✅ AdobeDRMCharacterizationTests 21 21 0 64ms
✅ AdobeDRMErrorGapTests 3 3 0 27ms
✅ AdobeDRMHandlerTests 12 12 0 753ms
✅ AdobeDRMServiceGapTests 2 2 0 2ms
✅ AlertModelCoverageTests 6 6 0 80ms
✅ AlertModelRetryTests 7 7 0 124ms
✅ AlertModelTests 2 2 0 2ms
✅ AlertPresentationRawGuardLintTests 6 6 0 50ms
✅ AlertUtilsTests 20 20 0 611ms
✅ AnnotationContractTests 3 3 0 8ms
✅ AnnotationDeviceIDTests 2 2 0 2ms
✅ AnnotationPostResponseContractTests 1 1 0 2ms
✅ AnnouncementChainTests 5 5 0 16ms
✅ AnnouncementTests 3 3 0 4ms
✅ AnonymousBorrowBaselineFixtureTests 13 13 0 77ms
✅ AnonymousBorrowCandidateFixtureTests 6 6 0 9ms
✅ AnonymousBorrowDeltaTests 2 2 0 17ms
✅ AppContainerAudiobookFactoryTests 3 3 0 8ms
✅ AppContainerAuthCoordinatorRegistrationTests 3 3 0 139ms
✅ AppContainerImageLoaderInjectionTests 4 4 0 156ms
✅ AppContainerIsolationLintTests 7 7 0 2.87s
✅ AppContainerResetTests 5 5 0 20.27s
✅ AppContainerTests 4 4 0 3ms
✅ AppContainerWithSignInModalSheetPresenterTests 2 2 0 2ms
✅ AppHealthViewModelTests 8 8 0 1.32s
✅ AppLaunchTrackerExtendedTests 16 16 0 433ms
✅ AppLaunchTrackerTests 10 10 0 334ms
✅ AppLaunchTrackerWiringTests 2 2 0 58ms
✅ AppRatingServiceOverrideTests 3 3 0 11ms
✅ AppRatingServiceTests 9 9 0 3.85s
✅ AppRouteTests 5 5 0 22ms
✅ AppTabHostMiniPlayerIntegrationTests 6 6 0 193ms
✅ AppTabHostViewBadgeCountTests 10 10 0 60ms
✅ AppTabRouterCoverageTests 4 4 0 9ms
✅ AppTabRouterGapTests 3 3 0 3ms
✅ ArrayExtensionsTests 6 6 0 118ms
✅ AudioBookmarkGapTests 6 6 0 168ms
✅ AudioEngineWrapperTests 8 8 0 164ms
✅ AudioInterruptionLogicTests 6 6 0 7ms
✅ AudioSessionActivatorTests 8 8 0 163ms
✅ AudiobookAccessibilityTests 7 7 0 31ms
✅ AudiobookBackgroundAudioTests 2 2 0 27ms
✅ AudiobookBookmarkBusinessLogicConcurrencyTests 3 3 0 99ms
✅ AudiobookBookmarkBusinessLogicPositionWriteTests 6 6 0 317ms
✅ AudiobookBookmarkBusinessLogicTests 21 21 0 434ms
✅ AudiobookChapterTOCNormalizationTests 6 6 0 6ms
✅ AudiobookColdLoadRecoveryTests 4 4 0 3ms
✅ AudiobookCrossVendorSmokeTests 4 4 0 41ms
✅ AudiobookDataManagerEmptyQueueTests 1 1 0 3ms
✅ AudiobookDataManagerErrorHandlingTests 5 5 0 10.13s
✅ AudiobookDataManagerModelsTests 20 20 0 1.07s
✅ AudiobookDataManagerNetworkSyncTests 5 5 0 5.09s
✅ AudiobookDataManagerSaveTests 4 4 0 42ms
✅ AudiobookDataManagerStoreRecoveryTests 5 5 0 2.06s
✅ AudiobookFileLoggerTests 14 14 0 239ms
✅ AudiobookFirstOpenHangTests 14 14 0 1.35s
✅ AudiobookLoadFailureSAMLReauthTests 10 10 0 1.43s
✅ AudiobookLoaderDispatchTests 7 7 0 121ms
✅ AudiobookLoaderFinalizeBuildTests 11 11 0 392ms
✅ AudiobookLoaderOPDSShapeMatrixTests 8 0 0 506ms
✅ AudiobookLoaderPredicateTests 11 11 0 13ms
✅ AudiobookLoaderTests 2 2 0 23ms
✅ AudiobookMorphingPlayerViewTests 10 10 0 40ms
✅ AudiobookNetworkValidationTests 3 3 0 8ms
✅ AudiobookOpenStateRaceTests 3 3 0 181ms
✅ AudiobookPhoneAlertContentTests 3 3 0 16ms
✅ AudiobookPlaybackStateTests 3 3 0 599ms
✅ AudiobookPlaybackTests 26 26 0 997ms
✅ AudiobookPlaytimesLifecycleTests 6 6 0 238ms
✅ AudiobookPositionAdapterContractTests 3 3 0 57ms
✅ AudiobookPositionPolicyValidatorTests 14 14 0 233ms
✅ AudiobookPositionRestoreTests 18 18 0 8.36s
✅ AudiobookSAMLReauthTests 6 6 0 31ms
✅ AudiobookSessionErrorDescriptionTests 4 4 0 31ms
✅ AudiobookSessionErrorExtTests 4 4 0 5ms
✅ AudiobookSessionErrorTests 3 3 0 3ms
✅ AudiobookSessionManagerErrorMappingTests 6 6 0 23ms
✅ AudiobookSessionManagerFlagGatePresentationTests 4 4 0 80ms
✅ AudiobookSessionManagerPresenterMigrationTests 10 10 0 5.74s
✅ AudiobookSessionManagerShutdownTests 12 12 0 687ms
✅ AudiobookSessionPresenterTests 31 31 0 3.62s
✅ AudiobookSessionStateTests 6 6 0 9ms
✅ AudiobookSessionStateTransitionTests 22 22 0 351ms
✅ AudiobookSkipIntervalSettingsTests 7 7 0 40ms
✅ AudiobookSleepTimerIntegrationTests 5 5 0 268ms
✅ AudiobookStorageLocationTests 3 3 0 7ms
✅ AudiobookTOCTests 18 18 0 408ms
✅ AudiobookTimeEntryTests 6 6 0 523ms
✅ AudiobookTimeTrackerEdgeTests 8 8 0 692ms
✅ AudiobookTimeTrackerLifecycleTests 5 5 0 1.62s
✅ AudiobookTimeTrackerTests 9 9 0 785ms
✅ AudiobookTrackCompletionTests 2 2 0 11ms
✅ AudiobookTypeRoutingTests 5 5 0 68ms
✅ AudiobookVendorAdapterTests 5 5 0 62ms
✅ AudiobookmarkTests 4 4 0 82ms
✅ AuthCoordinatorTelemetryTests 5 5 0 272ms
✅ AuthDecisionEventEmissionTests 7 7 0 11ms
✅ AuthDocumentContractTests 2 2 0 5ms
✅ AuthDocumentVariantsContractTests 5 5 0 23ms
✅ AuthErrorCategoryTests 12 12 0 62ms
✅ AuthErrorProblemDocSeamTests 6 6 0 45ms
✅ AuthFlowSecurityTests 3 0 0 51ms
✅ AuthReducerTests 21 21 0 1.40s
✅ AuthTypeTests 7 7 0 44ms
✅ AuthenticationTests 16 16 0 149ms
✅ BackgroundDownloadHandlerTests 28 28 0 457ms
✅ BackgroundListenerTests 2 2 0 26ms
✅ BackgroundSessionRoutingTests 6 6 0 83ms
✅ BackupExclusionMigrationTests 3 3 0 6ms
✅ BadgeDefinitionTests 33 33 0 74ms
✅ BadgeServiceTests 16 16 0 135ms
✅ BadgeUnlockPhaseTests 4 4 0 7ms
✅ BadgesViewModelTests 14 14 0 212ms
✅ BasicAuthEmptyCredentialTests 4 4 0 6ms
✅ BearerTokenAdapterTests 5 4 0 62ms
✅ BearerTokenFulfillFlowTests 4 4 0 64ms
✅ BearerTokenRefreshTests 4 4 0 18ms
✅ BearerTokenResponseDetectionTests 7 7 0 415ms
✅ BeginningPositionPolicyTests 8 8 0 46ms
✅ BookAvailabilityFormatterTests 18 18 0 115ms
✅ BookButtonMapperHoldReadyTests 10 10 0 1.01s
✅ BookButtonMapperTests 21 21 0 619ms
✅ BookButtonMapperViewModelTests 18 18 0 75ms
✅ BookButtonStateTests 8 8 0 304ms
✅ BookButtonTypeMetaTests 4 4 0 12ms
✅ BookButtonTypeTests 13 13 0 23ms
✅ BookCellModelActionTests 18 18 0 818ms
✅ BookCellModelCacheInvalidationTests 8 8 0 73ms
✅ BookCellModelCachePrefetchSafetyTests 9 9 0 155ms
✅ BookCellModelCacheTests 22 22 0 5.76s
✅ BookCellModelComputedPropertyTests 19 19 0 4.99s
✅ BookCellModelOfflineTests 9 9 0 187ms
✅ BookCellModelRegistryBindingTests 4 4 0 1.94s
✅ BookCellModelStateTests 16 16 0 6.31s
✅ BookCellModelStreamingHTMLTests 2 2 0 55ms
✅ BookCellStateComprehensiveTests 14 14 0 94ms
✅ BookContentResetServiceTests 2 2 0 7ms
✅ BookDetailMetadataHydrationTests 6 6 0 1.81s
✅ BookDetailViewModelAudiobookDismissTests 1 1 0 61ms
✅ BookDetailViewModelTests 91 91 0 24.21s
✅ BookFileManagerSideloadResolutionTests 4 4 0 1.13s
✅ BookFileManagerTests 8 8 0 71ms
✅ BookListViewAccessibilityTests 9 9 0 182ms
✅ BookPreviewTests 4 4 0 19ms
✅ BookRegistryStoreTests 26 26 0 296ms
✅ BookRegistrySyncReadinessTests 3 2 0 180ms
✅ BookRegistrySyncReentrancyTests 6 6 0 2.90s
✅ BookRegistrySyncSideloadExemptionTests 2 0 0 2.04s
✅ BookRegistrySyncTests 35 30 0 769ms
✅ BookReturnCleverReauthTests 1 1 0 23ms
✅ BookReturnServiceAuthCoordinatorTests 3 3 0 370ms
✅ BookReturnServiceContractTests 6 6 0 265ms
✅ BookReturnServiceTests 16 16 0 618ms
✅ BookServiceAudiobookOpenTests 2 2 0 21ms
✅ BookSignInRedirectHandlerTests 8 8 0 226ms
✅ BookStateIntegrationTests 8 8 0 188ms
✅ BookmarkBusinessLogicExtendedTests 6 6 0 195ms
✅ BookmarkDeletionLogTests 3 3 0 98ms
✅ BookmarkDeviceIdMatchingTests 3 3 0 124ms
✅ BookmarkExistenceTests 4 4 0 642ms
✅ BookmarkManagerTests 24 24 0 249ms
✅ BookmarkSortingTests 1 1 0 37ms
✅ BookmarkSyncTests 3 3 0 80ms
✅ BorrowAndDownloadIntegrationTests 7 7 0 342ms
✅ BorrowErrorMessageTests 13 13 0 26ms
✅ BorrowErrorPresenterTests 6 6 0 1.52s
✅ BorrowOperationAuthCoordinatorTests 6 6 0 4.54s
✅ BorrowOperationCleverReauthTests 2 2 0 375ms
✅ BorrowOperationContractTests 6 6 0 441ms
✅ BorrowOperationStreamingHTMLTests 3 3 0 343ms
✅ BorrowOperationTests 13 13 0 1.92s
✅ BorrowOperationTimeoutTests 3 3 0 132ms
✅ BorrowReducerContractTests 2 2 0 24ms
✅ BorrowReducerTests 21 21 0 146ms
✅ BundledRegistrySnapshotTests 5 5 0 176ms
✅ ButtonStateMonotonicClampTests 10 10 0 3.10s
✅ ButtonStateTests 16 16 0 97ms
✅ ButtonStyleTypeTests 2 2 0 193ms
✅ C64ConversionTests 6 6 0 6ms
✅ CarPlayAudiobookBridgePresenterMigrationTests 2 2 0 1.23s
✅ CarPlayAuthHelperReadinessTests 3 3 0 412ms
✅ CarPlayChapterListTests 3 3 0 125ms
✅ CarPlayIntegrationTests 2 2 0 127ms
✅ CarPlayLibraryRefreshTests 3 3 0 496ms
✅ CarPlayNowPlayingTemplateTests 4 4 0 535ms
✅ CarPlayOpenAppAlertTests 6 6 0 499ms
✅ CarPlayPlaybackErrorTests 8 8 0 8ms
✅ CarPlayTests 12 12 0 85ms
✅ CarPlayTimeTrackingTests 3 3 0 219ms
✅ CatalogAPIDedupeTests 3 3 0 484ms
✅ CatalogAPIEntryPointTests 1 1 0 2ms
✅ CatalogAccessibilityTests 8 8 0 44ms
❌ CatalogCacheKeyAndIsolationTests 12 11 1 2m 0s
✅ CatalogCacheMetadataExactBoundaryTests 4 4 0 12ms
✅ CatalogCacheMetadataTests 21 21 0 59ms
✅ CatalogFeedModelTests 4 4 0 17ms
✅ CatalogFilterGroupModelTests 17 17 0 103ms
✅ CatalogFilterModelTests 17 17 0 127ms
✅ CatalogFilterServiceTests 29 29 0 96ms
✅ CatalogFilterTests 1 1 0 1ms
✅ CatalogLaneAssemblyTests 7 7 0 46ms
✅ CatalogLaneModelStructTests 20 20 0 180ms
✅ CatalogLaneModelTests 3 3 0 3ms
✅ CatalogLaneMoreFilterStateTests 8 8 0 48ms
✅ CatalogLaneMoreViewModelTests 43 43 0 13.77s
✅ CatalogLaneRowViewAccessibilityTests 11 11 0 411ms
✅ CatalogLaneSortingTests 5 5 0 105ms
✅ CatalogLoadIntegrationTests 6 6 0 40ms
✅ CatalogOPDS2NegotiationTests 12 12 0 150ms
✅ CatalogPreloaderTests 6 6 0 39ms
✅ CatalogProblemDocumentTests 6 6 0 119ms
✅ CatalogRepositoryCoreTests 9 9 0 1.10s
✅ CatalogRepositoryStaleWhileRevalidateTests 12 12 0 1.29s
✅ CatalogRepositoryTests 19 19 0 298ms
✅ CatalogSearchViewModelRegistryUpdateTests 5 5 0 1.68s
✅ CatalogSearchViewModelTests 67 67 0 20.44s
✅ CatalogSelectorsTests 2 2 0 3ms
✅ CatalogSortServiceTests 14 14 0 122ms
✅ CatalogStateTests 7 7 0 48ms
✅ CatalogViewContinueRowsIntegrationTests 3 3 0 30ms
✅ CatalogViewModelStateMachineTests 19 19 0 285ms
✅ ChaosFaultInjectionTests 5 5 0 29ms
✅ ChapterChangeDetectorTests 5 5 0 17ms
✅ ChapterTOCNormalizerTests 7 7 0 6ms
✅ CirculationAnalyticsTests 4 4 0 6ms
✅ ColdStartResumeIntegrationTests 10 10 0 922ms
✅ ColorExtensionTests 5 5 0 6ms
✅ ConcurrentBookStateTests 3 3 0 20ms
✅ ConcurrentDownloadStateTests 3 3 0 13ms
✅ ConcurrentTokenRefreshTests 2 2 0 300ms
✅ ContinueRowSectionTests 6 6 0 26ms
✅ ContinuousPlaybackTrackingTests 3 3 0 190ms
✅ CookiePersistenceTests 10 10 0 2.69s
✅ CrawlStateTests 16 16 0 731ms
✅ CrawlableFeedAnalysisTests 17 17 0 1.25s
✅ CrawlerFallbackTests 12 12 0 570ms
✅ CredentialEdgeCaseTests 6 6 0 8ms
✅ CredentialPrivacyTests 4 4 0 6ms
✅ CredentialPromptCoordinatorTests 4 4 0 344ms
✅ CredentialSnapshotInvalidationTests 5 0 0 90ms
✅ CrossDeviceBookmarkSyncTests 12 12 0 17ms
✅ CrossDeviceSyncE2ETests 5 5 0 2.13s
✅ CrossDomain401Tests 8 8 0 52ms
✅ CrossFormatMappingTests 14 14 0 58ms
✅ DPLAErrorTests 3 3 0 401ms
✅ DRMAdversarialTests 4 1 0 15ms
✅ DRMFulfilledPublicationTests 6 6 0 21ms
✅ DataBase64Tests 3 3 0 10ms
✅ DataReceptionComparisonTests 2 2 0 32ms
✅ DateExtensionTests 9 9 0 20ms
✅ DateFormattingTests 4 4 0 5ms
✅ Date_NYPLAdditionsTests 7 7 0 380ms
✅ DebugSettingsForceSkeletonsTests 4 4 0 143ms
✅ DebugSettingsGapTests 4 4 0 8ms
✅ DebugSettingsTests 31 31 0 98ms
✅ DefaultCatalogAPITests 31 31 0 1.58s
✅ DefaultRecentlyReadingServiceTests 13 13 0 70ms
✅ DeriveInitialStateTests 4 4 0 14ms
✅ DeveloperSettingsEngineeringTierTests 4 4 0 4ms
✅ DeveloperSettingsViewModelOverrideTests 3 0 0 14ms
✅ DeviceLogCollectorGapTests 2 2 0 12.92s
✅ DeviceLogCollectorTests 9 9 0 3m 4s
✅ DeviceOrientationTests 7 7 0 83ms
✅ DeviceSpecificErrorMonitorTests 11 11 0 27ms
✅ DictionaryExtensionsTests 5 5 0 6ms
✅ DiskBudgetManagerTests 7 7 0 9ms
✅ DiskBudgetTests 2 2 0 3ms
✅ DownloadAlertPresenterTests 8 8 0 284ms
✅ DownloadAnnouncementServiceTests 12 12 0 32ms
✅ DownloadAuthRetryHandlerAuthCoordinatorTests 6 6 0 2.66s
✅ DownloadAuthRetryHandlerTaskLifecycleTests 4 4 0 399ms
✅ DownloadAuthRetryHandlerTests 17 17 0 4.56s
✅ DownloadCancellationHandlerTests 5 5 0 330ms
✅ DownloadCompleteMomentTests 6 6 0 4ms
✅ DownloadCompletionParserTests 9 9 0 7.61s
✅ DownloadCoordinatorIntegrationTests 10 10 0 69ms
✅ DownloadCoordinatorTests 11 11 0 102ms
✅ DownloadDiskSpaceTests 2 2 0 5ms
✅ DownloadErrorInfoTests 3 3 0 2ms
✅ DownloadErrorRecoveryPolicyTests 11 11 0 5.54s
✅ DownloadErrorRecoveryTests 3 3 0 12ms
✅ DownloadFreeSpaceExhaustionTests 11 11 0 84ms
✅ DownloadInfoTests 5 5 0 34ms
✅ DownloadIntegrityTests 10 10 0 57ms
✅ DownloadOnlyOnWiFiTests 10 10 0 17ms
✅ DownloadPersistenceStoreTests 5 5 0 64ms
✅ DownloadProgressPublisherCoreTests 19 19 0 596ms
✅ DownloadProgressPublisherTests 2 2 0 5ms
✅ DownloadQueueIntegrationTests 3 3 0 32ms
✅ DownloadQueueOrchestratorTests 9 9 0 157ms
✅ DownloadRMSDKHandoffTests 1 1 0 <1ms
✅ DownloadReconciliationLaunchOrderContractTests 2 2 0 32ms
✅ DownloadReconciliationTests 17 17 0 172ms
✅ DownloadRedirectTests 7 7 0 13ms
✅ DownloadResumeAfterKillTests 7 7 0 77ms
✅ DownloadSlotManagementTests 5 5 0 12ms
✅ DownloadStartCoordinatorContractTests 5 5 0 56ms
✅ DownloadStartCoordinatorTests 9 9 0 189ms
✅ DownloadStartDispatcherTests 26 26 0 138ms
✅ DownloadStateMachineIntegrationTests 15 15 0 349ms
✅ DownloadStateMachineTests 5 5 0 50ms
✅ DownloadStateManagerTests 16 16 0 1.38s
✅ DownloadTaskLifecycleServiceTests 9 9 0 59ms
✅ DownloadTaskPersistenceTests 14 14 0 58ms
✅ DownloadThrottlingServiceTests 10 10 0 393ms
✅ DownloadTransferRetryTests 6 6 0 2.09s
✅ DownloadWatchdogTests 3 3 0 37ms
✅ EPUBKeyCommandsPP4289Tests 4 4 0 13ms
✅ EPUBModuleTests 4 4 0 14ms
✅ EPUBPositionTests 10 10 0 44ms
✅ EPUBSearchViewModelTests 18 18 0 420ms
✅ EPUBToolbarToggleTests 11 11 0 24ms
✅ EmailAddressTests 16 16 0 136ms
✅ EpubSampleFactoryTests 5 5 0 20ms
✅ ErrorActivityTrackerTests 12 12 0 95ms
✅ ErrorDetailTests 12 12 0 539ms
✅ ErrorDetailViewControllerGapTests 3 3 0 47ms
✅ ErrorDetailViewControllerTests 14 14 0 195ms
✅ ErrorLogExporterTests 5 5 0 71ms
✅ ExecutorNetworkHermeticityTests 1 1 0 70ms
✅ ExpiredLoanStringsTests 5 5 0 6ms
✅ FacetEnumTests 3 3 0 2ms
✅ FacetToolbarAccessibilityTests 5 5 0 286ms
✅ FacetViewModelLogoDelegateTests 4 4 0 9ms
✅ FacetViewModelTests 18 18 0 4.22s
✅ FetchManifestWithBearerTokenLCPSafetyTests 1 1 0 10ms
✅ FetchManifestWithBearerTokenTests 9 9 0 316ms
✅ FetchOpenAccessManifestLCPSafetyTests 4 4 0 78ms
✅ FileURLGenerationTests 3 3 0 10ms
✅ FindawayChapterStatusGuardTests 1 1 0 3ms
✅ FindawaySavedVsPlayedTests 1 1 0 90ms
✅ FloatTPPAdditionsTests 5 5 0 63ms
✅ FocusIndicationTests 7 7 0 25ms
✅ FontManagerTests 17 17 0 522ms
✅ ForceResetTests 6 6 0 564ms
✅ GeneralCacheClearOnUpdateTests 3 3 0 29ms
✅ GeneralCacheTests 20 20 0 360ms
✅ GroupEnumTests 1 1 0 11ms
✅ HTMLTextViewTests 70 70 0 17.96s
✅ HoldNotificationClassificationTests 2 2 0 4ms
✅ HoldsBadgeCountTests 9 9 0 61ms
✅ HoldsBookViewModelTests 8 8 0 481ms
✅ HoldsReducerTests 11 11 0 39ms
✅ HoldsSyncFailureTests 12 12 0 100ms
✅ HoldsViewModelTests 23 23 0 1.13s
✅ HostFailureTrackerTests 2 2 0 14ms
✅ ImageCacheContinuationTests 1 1 0 17.83s
✅ ImageCacheTypeTests 1 1 0 1ms
✅ ImageCoverKeyUnificationTests 2 2 0 1ms
✅ ImageLoaderTests 14 14 0 561ms
✅ InflightFeedFetchesTimeoutTests 4 4 0 10.30s
✅ IntExtensionsTests 4 4 0 18ms
✅ IsReaderActiveTrackingModifierTests 4 4 0 243ms
✅ KeyboardNavigationFKATests 11 11 0 458ms
✅ KeyboardNavigationHandlerTests 16 16 0 608ms
✅ KeyboardVoiceOverTests 5 5 0 37ms
✅ LCPAcquisitionPredicateTests 4 4 0 4ms
✅ LCPAdapterTests 8 8 0 107ms
✅ LCPAudiobookURLSchemeTests 4 4 0 4ms
✅ LCPAudiobooksTests 21 21 0 120ms
✅ LCPBotanCRLGuardTests 5 5 0 11ms
✅ LCPCharacterizationTests 31 31 0 153ms
✅ LCPClientTests 8 8 0 49ms
✅ LCPFulfillmentHandlerTests 8 8 0 722ms
✅ LCPKeychainMigrationTests 3 3 0 502ms
✅ LCPLibraryServiceTests 20 20 0 393ms
✅ LCPLicenseDocumentDetectionTests 5 5 0 12ms
✅ LCPLicenseFilePathTests 3 3 0 4ms
✅ LCPOrphanedDownloadRegistryTests 4 4 0 11ms
✅ LCPPDFAcquisitionPredicateTests 5 5 0 60ms
✅ LCPPDFDiskExtractTests 5 5 0 41ms
✅ LCPPDFOpenProgressTests 13 13 0 80ms
✅ LCPPassphraseReadinessTests 2 2 0 99ms
✅ LCPSessionIdentifierTests 3 3 0 4ms
✅ LegacySAMLProblemDocumentPropagationTests 7 7 0 1.50s
✅ LibrariesSectionViewModelTests 16 16 0 123ms
✅ LibraryCatalogMergerTests 9 9 0 35ms
✅ LibraryRegistryCrawlerTests 15 15 0 1.78s
✅ LicensesServiceTests 4 4 0 14ms
✅ LiveCrawlableParsingTest 4 0 0 53ms
✅ LoanEvictionPolicyTests 13 13 0 34ms
✅ LoanRenewalServiceTests 9 9 0 521ms
✅ LocalBookContentServiceTests 7 7 0 63ms
✅ LocalFileAdapterTests 6 5 0 34ms
✅ LogTests 13 13 0 361ms
✅ LoginKeyboardTests 8 8 0 89ms
✅ MainActorHelpersTests 22 22 0 635ms
✅ MappedCatalogBridgeTests 3 3 0 5ms
✅ MappedCatalogModelTests 11 11 0 1.03s
✅ MockBackendExpiredCredentialsTests 3 3 0 21ms
✅ MockBackendHoldsTests 3 3 0 63ms
✅ MockBackendIntegrationTests 4 4 0 91ms
✅ MockBackendLoanLimitTests 2 2 0 21ms
✅ MockBackendRouteMatchingTests 4 4 0 4ms
✅ MockBackendServerDownTests 1 1 0 19ms
✅ MockIsolationLintTests 5 5 0 1.54s
✅ MultiLibraryTokenIsolationTests 14 14 0 271ms
✅ MyBooksDownloadCenterAccountIdThreadingTests 7 7 0 524ms
✅ MyBooksDownloadCenterAdeptGapTests 3 3 0 93ms
✅ MyBooksDownloadCenterConcurrencyTests 22 22 0 353ms
✅ MyBooksDownloadCenterEvictionTests 7 7 0 69ms
✅ MyBooksDownloadCenterOfflineTests 8 8 0 589ms
✅ MyBooksDownloadSessionInvalidationTests 3 3 0 85ms
✅ MyBooksSimplifiedBearerTokenTests 17 17 0 661ms
✅ MyBooksViewModelBooksPublisherTests 3 3 0 64ms
✅ MyBooksViewModelConcurrencyTests 4 4 0 37ms
✅ MyBooksViewModelDownloadStateTests 3 3 0 21ms
✅ MyBooksViewModelEmptyArrayTests 3 3 0 4ms
✅ MyBooksViewModelEmptyStateTests 4 4 0 21ms
✅ MyBooksViewModelExtendedTests 15 15 0 7.16s
✅ MyBooksViewModelFacetIntegrationTests 4 4 0 11ms
✅ MyBooksViewModelFacetPublisherTests 5 5 0 34ms
✅ MyBooksViewModelFilterSortInteractionTests 2 2 0 14ms
✅ MyBooksViewModelFilterTests 9 9 0 141ms
✅ MyBooksViewModelGuardConditionsTests 2 2 0 13ms
✅ MyBooksViewModelLargeDatasetTests 2 2 0 185ms
✅ MyBooksViewModelLoadAccountTests 2 2 0 134ms
✅ MyBooksViewModelLoginStateTests 4 4 0 615ms
✅ MyBooksViewModelMultipleAuthorSortingTests 3 3 0 13ms
✅ MyBooksViewModelNotificationTests 4 4 0 336ms
✅ MyBooksViewModelOfflineFilteringTests 3 3 0 11ms
✅ MyBooksViewModelPublisherTests 7 7 0 55ms
✅ MyBooksViewModelSearchEdgeCaseTests 6 6 0 69ms
✅ MyBooksViewModelSearchQueryTests 3 3 0 7ms
✅ MyBooksViewModelSortPersistenceTests 3 3 0 905ms
✅ MyBooksViewModelSortingIntegrationTests 5 5 0 32ms
✅ MyBooksViewModelSortingTests 6 6 0 29ms
✅ MyBooksViewModelStateTransitionTests 3 3 0 346ms
✅ MyBooksViewModelUIBindingTests 3 3 0 7ms
✅ NSErrorAdditionsTests 7 7 0 8ms
✅ NSNotificationTPPTests 3 3 0 11ms
✅ NavigationCoordinatorTests 18 18 0 38ms
✅ NavigationFreezePreventionTests 5 5 0 263ms
✅ NetworkCacheClearRoutingTests 3 3 0 17ms
✅ NetworkExecutorCredentialGuardTests 8 8 0 108ms
✅ NetworkExecutorResponseRegressionTests 4 4 0 30ms
✅ NetworkExecutorTaskTypeTests 3 3 0 30ms
✅ NetworkOfflineDetectionTests 3 3 0 14ms
✅ NetworkQueueTests 11 11 0 589ms
✅ NetworkRequestQueueTests 2 2 0 10.09s
✅ NetworkRetryLogicTests 7 7 0 27ms
✅ NetworkTimeoutTests 2 2 0 2ms
✅ NotificationEventTypeContractTests 7 7 0 10ms
✅ NotificationPayloadContractTests 10 10 0 14ms
✅ NotificationServiceStateMachineTests 9 9 0 521ms
✅ NotificationServiceTests 16 16 0 25ms
✅ NotificationServiceTokenTests 13 13 0 37ms
✅ NotificationSyncThrottleTests 5 5 0 5ms
✅ NotificationTokenDataTests 4 4 0 12ms
✅ NotificationTokenRegistrationTests 10 10 0 452ms
✅ NowPlayingCoordinatorBackgroundTests 6 6 0 1.17s
✅ NowPlayingCoordinatorTests 19 19 0 1.90s
✅ OAuthSAMLRedirectRegressionTests 4 4 0 146ms
✅ OIDCAuthDocumentParsingTests 4 4 0 78ms
✅ OIDCAuthTypeTests 5 5 0 4ms
✅ OIDCAuthenticationPropertyTests 8 8 0 194ms
✅ OIDCCallbackEdgeCaseTests 9 9 0 962ms
✅ OIDCCallbackHandlingTests 5 5 0 166ms
✅ OIDCCallbackSchemeTests 3 3 0 4ms
✅ OIDCIsolationRegressionTests 6 6 0 1.29s
✅ OIDCLoginRoutingTests 3 3 0 611ms
✅ OIDCMakeRequestTests 3 3 0 109ms
✅ OIDCNSCodingTests 1 1 0 46ms
✅ OIDCNetworkLayer401Tests 5 5 0 336ms
✅ OIDCReauthOnExpiredTokenTests 5 5 0 135ms
✅ OIDCRedirectURIConstructionTests 6 6 0 210ms
✅ OIDCRegressionTests 9 9 0 270ms
✅ OIDCSelectedAuthenticationTests 2 2 0 274ms
✅ OIDCSignOutRegressionTests 6 6 0 284ms
✅ OIDCTokenRefreshRegressionTests 6 6 0 1.43s
✅ OIDCUpdateUserAccountTests 5 5 0 157ms
✅ OIDCViewModelRegressionTests 1 1 0 25ms
✅ OIDCViewModelSignInTests 2 2 0 547ms
✅ OPDS1BorrowEntryContractTests 4 4 0 9ms
✅ OPDS1CatalogGroupedContractTests 3 3 0 89ms
✅ OPDS1HoldEntriesContractTests 4 4 0 9ms
✅ OPDS1LoansFeedContractTests 6 6 0 147ms
✅ OPDS1ParsingTests 34 34 0 247ms
✅ OPDS1RevokeResponseContractTests 2 2 0 8ms
✅ OPDS2AuthenticationDocumentTests 18 18 0 74ms
✅ OPDS2AvailabilityTests 4 4 0 10ms
✅ OPDS2BookBridgeTests 44 44 0 522ms
✅ OPDS2BorrowResponseContractTests 3 3 0 6ms
✅ OPDS2CatalogWiringTests 21 21 0 200ms
✅ OPDS2CatalogsFeedTests 3 3 0 90ms
✅ OPDS2ContributorTests 2 2 0 2ms
✅ OPDS2EmptyFeedContractTests 1 1 0 2ms
✅ OPDS2FeedContractTests 4 4 0 36ms
✅ OPDS2FeedParsingTests 11 11 0 1.06s
✅ OPDS2FeedTests 14 14 0 77ms
✅ OPDS2FullMetadataTests 4 4 0 13ms
✅ OPDS2FullPublicationTests 13 13 0 1.93s
✅ OPDS2IntegrationTests 18 18 0 2.74s
✅ OPDS2LinkArrayTests 5 5 0 26ms
✅ OPDS2LinkComputedPropertyTests 20 20 0 47ms
✅ OPDS2LinkRelTests 1 1 0 <1ms
✅ OPDS2LinkTests 2 2 0 42ms
✅ OPDS2ParsingTests 38 38 0 291ms
✅ OPDS2PublicationExtendedTests 53 53 0 799ms
✅ OPDS2PublicationImageTests 6 6 0 1.21s
✅ OPDS2PublicationNarratorTests 3 3 0 5ms
✅ OPDS2PublicationTests 2 2 0 59ms
✅ OPDS2SamlIDPTests 6 6 0 12ms
✅ OPDS2SearchResultsContractTests 3 3 0 18ms
✅ OPDS2SubjectTests 2 2 0 3ms
✅ OPDS2SupportingTypesTests 5 5 0 189ms
✅ OPDSAcquisitionPathExpandedTests 15 15 0 140ms
✅ OPDSFeedCacheTests 14 14 0 721ms
✅ OPDSFeedMigrationTests 11 11 0 22ms
✅ OPDSFeedParsingTests 2 2 0 53ms
✅ OPDSFeedServiceStateMachineTests 3 3 0 236ms
✅ OPDSFeedServiceTests 2 2 0 15ms
✅ OPDSFormatTests 13 13 0 441ms
✅ OPDSParserCoreTests 4 4 0 613ms
✅ OPDSParserTests 4 4 0 5ms
✅ OPDSParsingTests 57 57 0 3.85s
✅ OfflineActionTests 29 29 0 74ms
✅ OfflineQueueCoordinatorTests 11 11 0 601ms
✅ OfflineQueueServiceExtendedTests 13 13 0 5.09s
✅ OfflineQueueServiceTests 17 17 0 6.89s
✅ OpenAccessAdapterTests 13 13 0 198ms
✅ OverdriveDeferredFulfillmentTests 6 6 0 3.09s
✅ OverdriveDownloadHandlerTests 9 9 0 182ms
✅ OverdriveFulfillmentTests 25 24 0 1.97s
✅ PDFExtensionsTests 20 20 0 61ms
✅ PDFKitThumbnailProviderTests 5 5 0 64ms
✅ PDFReaderTests 12 12 0 54ms
✅ PDFSearchEmptyStateTests 4 4 0 4ms
✅ PP3596RegressionTests 3 3 0 75ms
❌ Palace 2 1 1 <1ms
✅ PalaceCheckPropertyTests 8 8 0 120ms
✅ PalaceErrorCategoryTests 20 20 0 539ms
✅ PalaceErrorExtendedTests 23 23 0 41ms
✅ PalaceErrorTests 11 11 0 75ms
✅ PalaceHapticTests 4 4 0 10ms
✅ PalaceMotionTests 11 11 0 17ms
✅ PalacePDFViewTests 12 12 0 105ms
✅ PalacePressableButtonStyleTests 6 6 0 7ms
✅ PalaceTestSetupObservationTests 4 4 0 9ms
✅ PalaceWiringTestCaseTests 4 4 0 11ms
✅ ParserFuzzTests 4 4 0 14.51s
✅ PatronProfileContractTests 4 4 0 996ms
✅ PerformanceMonitorTests 14 14 0 193ms
✅ PerformanceReportTests 14 14 0 110ms
✅ PersistentLoggerTests 9 9 0 1.26s
✅ PlaybackBootstrapperAudioSessionTests 2 2 0 46ms
✅ PlaybackBootstrapperTests 8 8 0 61ms
✅ PlaybackFailureRecordTests 5 5 0 33ms
✅ PlaybackOpenPolicyTests 7 7 0 25ms
✅ PlaybackRateTests 18 18 0 112ms
✅ PlaybackTrackingRegressionTests 5 5 0 68ms
✅ PoolResponsivenessProbeTests 5 4 0 2.00s
✅ PositionPersistenceLogicTests 6 6 0 5ms
✅ PositionPersistenceTests 2 2 0 112ms
✅ PositionSyncServiceTests 13 13 0 3.08s
✅ PositionSyncTests 5 5 0 689ms
✅ PositionWriterContractTests 6 6 0 109ms
✅ PostUpdateMigrationTests 5 5 0 17ms
✅ ProblemDocumentContractTests 4 4 0 15ms
✅ ProblemDocumentLoanExpiryTests 5 5 0 36ms
✅ ProblemDocumentTests 12 12 0 51ms
✅ ProblemReportEmailTests 8 8 0 20ms
✅ RatingCardMotionGateTests 5 5 0 6ms
✅ RatingEligibilityPolicyTests 17 17 0 285ms
✅ RatingEngagementTrackerTests 9 9 0 39ms
✅ RatingFeedbackPresenterTests 3 3 0 366ms
✅ RatingPromptPresenterTests 15 15 0 96ms
✅ ReachabilityTests 10 10 0 2.05s
✅ Reader2BookmarkContractTests 3 3 0 99ms
✅ Reader2PositionAdapterContractTests 4 3 0 806ms
✅ Reader2PositionResumeContractTests 3 3 0 133ms
✅ ReaderAccessibilityTests 7 7 0 6ms
✅ ReaderChromeToggleFadeTests 3 3 0 11ms
✅ ReaderEditingActionsTests 5 5 0 22ms
✅ ReaderErrorTests 5 5 0 8ms
✅ ReaderNavBarVoiceOverTests 2 2 0 4ms
✅ ReaderServicePDFRouteTests 3 3 0 19ms
✅ ReaderServiceSyncTests 3 3 0 53ms
✅ ReaderThemeTests 24 24 0 107ms
✅ ReadingPositionTests 22 22 0 132ms
✅ ReadingSessionTrackerTests 13 13 0 125ms
✅ ReadingStatsServiceTests 12 12 0 102ms
✅ ReadingStatsStoreTests 9 9 0 72ms
✅ RedirectHandlingIntegrationTests 4 4 0 17ms
✅ RedirectPolicyTests 9 9 0 47ms
✅ RegistryFileRecoveryTests 21 21 0 88ms
✅ RemoteFeatureFlagsGapTests 4 4 0 64ms
✅ RemoteFeatureFlagsSideLoadingTests 5 5 0 17ms
❌ RemoteFeatureFlagsTests 20 19 1 2m 0s
✅ ResourcePropertiesLengthTests 3 3 0 21ms
✅ RetryClassificationTests 17 17 0 24ms
✅ ReturnFlowTests 1 1 0 1ms
✅ RightsManagementDetectionTests 5 5 0 50ms
✅ RightsManagementDispatcherTests 10 10 0 186ms
✅ RuntimeQuiescenceGateTests 11 10 0 1.92s
✅ RuntimeQuiescenceLintTests 5 5 0 658ms
✅ SAMLCookieSyncTests 5 5 0 31ms
✅ SAMLLogoutCallbackDetectionTests 4 4 0 10ms
✅ SAMLLogoutLinkParsingTests 5 5 0 30ms
✅ SAMLLogoutURLTests 4 4 0 273ms
✅ SAMLPlusBiblioBoardExpirationTests 8 8 0 777ms
✅ SEMigrationsTests 6 6 0 146ms
✅ SafeDictionaryTests 21 21 0 274ms
✅ SamplePlayerErrorTests 5 5 0 12ms
✅ SampleTypeTests 8 8 0 22ms
✅ SceneDelegateTests 1 1 0 8ms
✅ ScopedResetTests 9 9 0 77ms
✅ SearchAccessibilityTests 11 11 0 25ms
✅ SearchFlowIntegrationTests 8 8 0 76ms
✅ SettingsViewModelComputedPropertyTests 6 6 0 14ms
✅ SettingsViewModelEdgeCaseTests 7 7 0 4.41s
✅ SettingsViewModelGapTests 1 1 0 3ms
✅ SettingsViewModelSyncTests 14 14 0 111ms
✅ SettingsViewModelTests 33 33 0 252ms
✅ SideloadImportContractTests 1 1 0 17ms
✅ SideloadedBookManagerTests 17 17 0 882ms
✅ SideloadedBookRegistryTests 14 14 0 117ms
✅ SideloadedLaneBridgeTests 6 6 0 30ms
✅ SideloadedLaneViewModelTests 7 7 0 61ms
✅ SignInFormPresentationTests 3 3 0 3ms
✅ SignInModalLifecycleTests 9 9 0 65ms
✅ SignInModalPredicateTests 3 3 0 65ms
✅ SignInModalSAMLOIDCTests 6 6 0 14ms
✅ SignInOAuthErrorPropagationTests 8 8 0 402ms
✅ SignInToReadFlowIntegrationTests 5 5 0 305ms
❌ SignInWebSheetIntegrationTests 5 4 1 1m 29s
✅ SignInWebSheetViewModelTests 31 31 0 342ms
✅ SignOutCacheClearingTests 3 3 0 27ms
✅ SingletonResetRegistryTests 5 5 0 19ms
✅ SkeletonTests 22 22 0 160ms
✅ StatsViewModelTests 10 10 0 1.70s
✅ StatusAnnouncementTests 22 22 0 1.04s
✅ StopPositionSaveTests 2 2 0 3ms
✅ StoreTests 5 5 0 21ms
✅ StreamingReaderPresentationContractTests 1 1 0 20ms
✅ StreamingReaderProgressStoreTests 7 7 0 46ms
✅ StreamingReaderViewControllerScrollRestoreTests 12 12 0 834ms
✅ StreamingReaderViewModelTests 9 9 0 21ms
✅ StringExtensionTests 8 8 0 27ms
✅ StringExtensionsTests 3 3 0 7ms
✅ StringHTMLEntitiesTests 7 7 0 6ms
✅ StringNYPLAdditionsTests 4 4 0 3ms
✅ String_NYPLAdditionsTests 4 4 0 352ms
✅ SupportSectionDecisionTests 5 5 0 5ms
✅ SyncConflictResolutionTests 3 3 0 10ms
✅ SyncDeletionGuardTests 5 5 0 21ms
✅ SyncDeletionRatioTests 6 6 0 27ms
✅ SyncPermissionTests 5 5 0 73ms
✅ TPPAccountAuthStateEnumTests 5 5 0 262ms
✅ TPPAccountListDataSourceTests 3 3 0 11ms
✅ TPPAdobeActivationSkipTests 6 6 0 549ms
✅ TPPAgeCheckCompletionTests 5 5 0 478ms
✅ TPPAgeCheckIsValidTests 5 5 0 11ms
✅ TPPAgeCheckStateMachineTests 4 4 0 302ms
✅ TPPAgeCheckTests 6 6 0 1.27s
✅ TPPAgeCheckVerifyDecisionTests 5 5 0 142ms
✅ TPPAlertUtilsTests 45 45 0 4.40s
✅ TPPAnnotationsHermeticTests 15 15 0 105ms
✅ TPPAnnotationsOverrideTests 4 4 0 80ms
✅ TPPAnnotationsTests 29 29 0 1.11s
✅ TPPAnnouncementManagerTests 3 3 0 18ms
✅ TPPAuthDocumentContractTests 3 3 0 25ms
✅ TPPBackgroundExecutorTests 3 3 0 28ms
✅ TPPBadgeImageGapTests 2 2 0 40ms
✅ TPPBaseReaderViewControllerInitialLocationTests 10 10 0 104ms
✅ TPPBasicAuthTests 11 11 0 848ms
✅ TPPBookAccessibilityLabelTests 8 8 0 32ms
✅ TPPBookAuthorCoverageTests 3 3 0 3ms
✅ TPPBookAuthorTests 6 6 0 16ms
✅ TPPBookBearerTokenTests 9 8 0 112ms
✅ TPPBookButtonsStateTests 7 7 0 24ms
✅ TPPBookContentMetadataFilesHelperTests 9 9 0 370ms
✅ TPPBookContentTypeConverterStreamingHTMLTests 2 2 0 2ms
✅ TPPBookContentTypeConverterTests 4 4 0 4ms
✅ TPPBookContentTypeExtendedTests 4 4 0 24ms
✅ TPPBookContentTypeTests 14 14 0 26ms
✅ TPPBookCoverRegistryTests 17 17 0 561ms
✅ TPPBookCreationTests 7 7 0 54ms
✅ TPPBookExtensionsTests 21 21 0 78ms
✅ TPPBookIsDRMProtectedTests 9 9 0 20ms
✅ TPPBookLocationCoverageTests 7 7 0 5ms
✅ TPPBookLocationEdgeCaseTests 27 27 0 2.36s
✅ TPPBookLocationKeyTests 3 3 0 4ms
✅ TPPBookLocationTests 11 11 0 1.12s
✅ TPPBookModelGapTests 4 4 0 142ms
✅ TPPBookRegistryAsyncReadinessTests 3 3 0 176ms
✅ TPPBookRegistryAtomicWriteTests 7 7 0 506ms
✅ TPPBookRegistryBookRetrievalTests 7 7 0 2.92s
✅ TPPBookRegistryBookmarkTests 7 7 0 4.27s
✅ TPPBookRegistryCorruptedDataTests 5 5 0 23ms
✅ TPPBookRegistryDataTests 4 4 0 3ms
✅ TPPBookRegistryDependencyTests 4 4 0 845ms
✅ TPPBookRegistryFulfillmentIdTests 4 4 0 9ms
✅ TPPBookRegistryLargeCorpusTests 5 5 0 27.21s
✅ TPPBookRegistryLoadReentrancyTests 2 2 0 500ms
✅ TPPBookRegistryLocationTests 4 4 0 64ms
✅ TPPBookRegistryMigrationTests 16 16 0 2.96s
✅ TPPBookRegistryPersistenceTests 10 10 0 1.94s
✅ TPPBookRegistryProcessingTests 2 2 0 19ms
✅ TPPBookRegistryPublisherTests 6 6 0 139ms
✅ TPPBookRegistryRecordPersistenceTests 3 3 0 99ms
✅ TPPBookRegistryRecordTests 10 10 0 29ms
✅ TPPBookRegistryStateConcurrencyTests 2 2 0 53ms
✅ TPPBookRegistryStateManagementTests 11 11 0 303ms
✅ TPPBookRegistryThreadSafetyTests 3 3 0 219ms
✅ TPPBookRegistryUpdateAndRemoveTests 1 1 0 360ms
✅ TPPBookRequiresAdobeDRMTests 6 6 0 48ms
✅ TPPBookSerializationTests 13 13 0 21ms
✅ TPPBookStateInitializationTests 4 4 0 3ms
✅ TPPBookStateTests 4 4 0 11ms
✅ TPPBookTests 98 98 0 3.24s
✅ TPPBookmarkDeletionLogTests 11 11 0 645ms
✅ TPPBookmarkFactoryInitTests 2 2 0 323ms
✅ TPPBookmarkFactoryServerAnnotationEdgeCaseTests 5 5 0 938ms
✅ TPPBookmarkFactoryTests 15 15 0 3.37s
✅ TPPBookmarkR3ConversionTests 5 5 0 16ms
✅ TPPBookmarkR3LocationTests 13 13 0 49ms
✅ TPPBookmarkSpecTests 1 1 0 3ms
✅ TPPCachingTests 3 3 0 47ms
✅ TPPCapturedCredentialsTests 5 5 0 173ms
✅ TPPConfigurationCustomRegistryTests 16 16 0 75ms
✅ TPPConfigurationTests 22 22 0 78ms
✅ TPPContentTypeTests 9 9 0 46ms
✅ TPPCredentialConcurrencyTests 3 3 0 8ms
✅ TPPCredentialIsolationE2ETests 5 0 0 1.47s
✅ TPPCredentialPersistenceTests 6 6 0 246ms
✅ TPPCredentialSnapshotCoherenceTests 3 0 0 958ms
✅ TPPCredentialSnapshotTests 8 8 0 12ms
✅ TPPCredentialsCoverageTests 9 9 0 48ms
✅ TPPCredentialsTests 26 26 0 4.92s
✅ TPPCrossLibrarySignOutTests 6 6 0 773ms
✅ TPPDRMFailureCredentialPreservationTests 4 4 0 94ms
✅ TPPErrorLoggerTests 27 27 0 114ms
✅ TPPIdleSignOutRegressionTests 13 13 0 1.64s
✅ TPPJWKConversionTest 1 1 0 8ms
✅ TPPKeychainManagerTests 5 5 0 47ms
✅ TPPLastReadPositionPosterTests 13 13 0 1.18s
✅ TPPLastReadPositionSynchronizerIntegrationTests 5 5 0 67ms
✅ TPPLastReadPositionSynchronizerTests 23 23 0 39ms
✅ TPPLastReadPositionSynchronizer_BehaviorDocumentationTests 5 5 0 296ms
✅ TPPLastReadPositionSynchronizer_BookLocationTests 9 9 0 115ms
✅ TPPLastReadPositionSynchronizer_ConcurrencyTests 3 3 0 148ms
✅ TPPLastReadPositionSynchronizer_ReadiumBookmarkTests 9 9 0 19ms
✅ TPPLastReadPositionSynchronizer_SyncLogicTests 10 10 0 405ms
✅ TPPLastReadPositionSynchronizer_WriterDelegationTests 4 4 0 92ms
✅ TPPLoginNoActivationTests 3 3 0 132ms
✅ TPPMainThreadCheckerTests 4 4 0 8ms
✅ TPPMigrationManagerTests 15 15 0 579ms
✅ TPPNetworkExecutorAPITests 14 14 0 431ms
✅ TPPNetworkExecutorConcurrencyTests 4 4 0 577ms
✅ TPPNetworkExecutorStubbedTests 17 17 0 198ms
✅ TPPNetworkExecutorTests 3 3 0 5ms
✅ TPPNetworkResponderAuthCoordinatorTests 5 5 0 75ms
✅ TPPNetworkResponderSizeLimitTests 5 5 0 242ms
✅ TPPNetworkResponderTests 12 12 0 244ms
✅ TPPOPDSAcquisitionPathTests 5 5 0 31ms
✅ TPPOPDSEntryTests 5 5 0 9ms
✅ TPPOPDSFeedTests 3 3 0 389ms
✅ TPPOPDSGroupSwiftTests 3 3 0 16ms
✅ TPPOPDSLinkTests 7 7 0 139ms
✅ TPPOpenSearchDescriptionExpandedTests 10 10 0 15ms
✅ TPPOpenSearchDescriptionTests 1 1 0 1ms
✅ TPPPDFDocumentMetadataTests 15 15 0 39ms
✅ TPPPDFDocumentTests 8 8 0 12ms
✅ TPPPDFLocationCoverageTests 7 7 0 49ms
✅ TPPPDFLocationTests 10 10 0 57ms
✅ TPPPDFPageBookmarkTests 9 9 0 28ms
✅ TPPPDFPageTests 5 5 0 13ms
✅ TPPPDFReaderModeTests 6 6 0 116ms
✅ TPPPDFReaderSearchBindingTests 3 3 0 14ms
✅ TPPPerAccountIsolationTests 8 0 0 150ms
✅ TPPPreferredAuthSelectionTests 8 8 0 242ms
✅ TPPProblemDocumentCacheManagerTests 12 12 0 40ms
✅ TPPProblemDocumentTests 21 21 0 45ms
✅ TPPReaderAppearanceTests 4 4 0 8ms
✅ TPPReaderBlockNavigationTests 12 12 0 119ms
✅ TPPReaderBookmarksBusinessLogicTests 12 12 0 3.99s
✅ TPPReaderBookmarksReadinessTests 2 2 0 92ms
✅ TPPReaderFontTests 4 4 0 3ms
✅ TPPReaderFootnoteAccessibilityTests 16 16 0 37ms
✅ TPPReaderPageListBusinessLogicTests 27 27 0 150ms
✅ TPPReaderPositionReportTests 10 10 0 8ms
✅ TPPReaderPreferencesLoadTests 3 3 0 34ms
✅ TPPReaderSettingsTests 28 28 0 752ms
✅ TPPReaderTOCBusinessLogicTests 15 15 0 3.21s
✅ TPPReaderTOCFlattenTests 2 2 0 1.05s
✅ TPPReadiumBookmarkLocationMatchingTests 5 5 0 16ms
✅ TPPReadiumBookmarkTests 23 23 0 55ms
✅ TPPReauthenticatorMockTests 2 2 0 24ms
✅ TPPReauthenticatorTests 4 4 0 28ms
✅ TPPReturnPromptHelperTests 5 5 0 142ms
✅ TPPSAMLCookieExpirationTests 7 7 0 39ms
✅ TPPSAMLFlowTests 10 10 0 48ms
✅ TPPSAMLReauthFlowTests 2 2 0 90ms
✅ TPPSAMLRegressionTests 4 4 0 67ms
✅ TPPSAMLSignInTests 26 26 0 2.39s
✅ TPPSAMLStateIsolationTests 4 4 0 64ms
✅ TPPSAMLStateMachineTests 6 6 0 1.78s
✅ TPPSettingsTests 6 6 0 279ms
✅ TPPSignInAdobeSkipTests 14 14 0 755ms
✅ TPPSignInAuthStateTransitionTests 3 3 0 316ms
✅ TPPSignInBusinessLogicExtendedTests 58 58 0 4.40s
✅ TPPSignInBusinessLogicOAuthTests 11 11 0 348ms
✅ TPPSignInBusinessLogicSignOutTests 11 11 0 427ms
✅ TPPSignInBusinessLogicStateMachineTests 10 10 0 1.18s
✅ TPPSignInBusinessLogicTests 18 18 0 1.17s
✅ TPPSignInBusinessLogicTokenFlowTests 3 3 0 141ms
✅ TPPSignInBusinessLogicValidationCallbackOrderTests 2 2 0 89ms
✅ TPPSignInErrorHandlingTests 2 2 0 68ms
✅ TPPSignInProfileDocEdgeCaseTests 3 3 0 119ms
✅ TPPSignedInStateProviderTests 3 3 0 678ms
✅ TPPUserAccountAuthStateTests 6 6 0 6ms
✅ TPPUserAccountConcurrencyTests 1 1 0 2ms
✅ TPPUserAccountGapTests 4 4 0 48ms
✅ TPPUserAccountIsolationLintTests 3 3 0 425ms
✅ TPPUserAccountTestFactoryTests 7 0 0 587ms
✅ TPPUserFriendlyErrorTests 11 11 0 12ms
✅ TPPUserNotificationsTests 10 10 0 77ms
✅ TPPXMLSwiftTests 16 16 0 2.10s
✅ TPPXMLTests 3 3 0 11ms
✅ TabBarModernizationTests 8 8 0 10ms
✅ TearDownRequiredLintTests 5 5 0 1.30s
✅ TestAppContainerFactoryTests 5 5 0 31ms
✅ TestTargetHermeticityRegressionTests 4 3 0 2.81s
✅ TimeEntryTests 3 3 0 21ms
✅ TokenRefreshAndRetryQueueTests 9 9 0 4.54s
✅ TokenRefreshIntegrationTests 2 2 0 13ms
✅ TokenRefreshInterceptorAuthCoordinatorTests 8 8 0 4.81s
✅ TokenRefreshInterceptorTests 24 24 0 6.82s
✅ TokenRefreshOnForegroundTests 10 10 0 1.94s
✅ TokenRefreshTests 25 25 0 554ms
✅ TokenRefreshWatchdogTests 5 5 0 49ms
✅ TokenRequestCredentialGuardTests 13 13 0 148ms
✅ TokenRequestTests 11 11 0 120ms
✅ TokenResponseTests 21 21 0 1.12s
✅ TriageBotKeyAdminTests 4 4 0 4ms
✅ TypographyPresetTests 21 21 0 525ms
✅ TypographyServiceTests 31 31 0 1.30s
✅ TypographySettingsViewModelTests 27 27 0 1.86s
✅ UIAlertCACommitGuardTests 9 9 0 589ms
✅ UIColor_NYPLAdditionsTests 1 1 0 <1ms
✅ URLBackupExclusionTests 3 3 0 9ms
✅ URLExtensionTests 16 16 0 69ms
✅ URLExtensionsTests 11 11 0 64ms
✅ URLRequestExtensionsCoverageTests 3 3 0 6ms
✅ URLRequestExtensionsTests 11 11 0 636ms
✅ URLRequestNYPLAdditionsTests 11 11 0 793ms
✅ URLRequest_NYPLTests 1 1 0 1ms
✅ URLResponseAuthenticationTests 10 10 0 35ms
✅ URLResponseNYPLTests 14 14 0 220ms
✅ URLSessionCredentialStorageTests 3 3 0 5ms
✅ URLSessionStubbingResetTests 2 2 0 9ms
✅ URLTypeTests 2 2 0 5ms
✅ URLValidationTests 5 5 0 7ms
✅ UnifiedOPDSServiceStateMachineTests 2 2 0 151ms
✅ UserAccountPublisherAuthStateTests 5 5 0 19ms
✅ UserAccountPublisherTests 14 14 0 280ms
✅ UserAccountValidationTests 11 11 0 397ms
✅ UserDefaultsIsolationLintTests 2 2 0 729ms
✅ UserProfileDocumentTests 7 7 0 17ms
✅ UserRetryTrackerTests 10 10 0 1.62s
✅ XCTestCase_testUserDefaultsTests 3 3 0 2.11s
✅ iPadOnMacRMSDKGuardTests 7 7 0 7ms
Failed Tests (click to expand)
Palace.PalaceTests
RemoteFeatureFlagsTests.testFetchIfNeeded_doesNotCrash
CatalogCacheKeyAndIsolationTests.testConcurrentStaleReads_AcrossDistinctURLs_EachURLGetsItsOwnRefresh
SignInWebSheetIntegrationTests.First Run

📊 Testing Coverage Breakdown

Unit Test Line Coverage (testable surfaces): 45.9%

Total coverage incl. UI/lifecycle: 44.9% (17 files excluded from testable denominator — see scripts/coverage-exclude.json)

Target Lines Covered
Palace.app 44.9%

Why two coverage numbers? Testable coverage subtracts files that can't be exercised from xcodebuild — SwiftUI views, UIKit VCs, lifecycle (see scripts/coverage-exclude.json) — so raising it means more testable logic is tested, not that we shipped less UI. Total coverage is kept for continuity. The excluded paths are covered by simdrive E2E journeys (see chaos-replay-on-pr.yml).


🔗 Interactive HTML Report | CI Run Details

📦 Downloadable Artifacts
Artifact Description
test-report 📄 Markdown + HTML reports
test-data 📊 JSON data for tooling
test-results 🔍 Full xcresult (open in Xcode)

@mauricecarrier7

Copy link
Copy Markdown
Contributor Author

Superseded by #1319 (full de-flake sweep). #1319 folds in this PR's SignOut/MultiLibrary joins plus the whole-tree swarm coverage — one coherent de-flake PR instead of two overlapping ones.

mauricecarrier7 added a commit that referenced this pull request Jul 21, 2026
… deterministic joins (#1319)

* test(network/signin): de-flake state-machine deadline-polls by joining the actual work

Four tests waited for fire-and-forget async work via a fixed wall-clock
deadline (asyncAfter probes / Task.sleep settle windows) and starved under
CI parallel oversubscription — the deadline elapses before the awaited work
lands and the test times out even though the work DID complete. Replaced each
poll with a deterministic JOIN of the real work; assertions unchanged.

- TPPSignInBusinessLogicStateMachineTests.testLogIn_racingAuthDocLoad_firesRequestOnceReady:
  dropped the 0.5s/1.5s asyncAfter probes; wake the instant the mock records
  the credential request via a new join seam.
- UnifiedOPDSServiceStateMachineTests.testFetchLoansFeed_blocksUntilLoaded_thenFetches
  & OPDSFeedServiceStateMachineTests (same name): dropped the 80ms settle sleep
  and joined the held fetch Task with `await fetchTask.value`. Mid-flight
  negatives hold without a settle — the awaitReady gate can't fire HTTP or
  complete while state is .detailsLoading.
- NotificationServiceStateMachineTests.testHoldNotification_blocksUntilLoaded_thenNavigates:
  dropped the 30ms subscribe-settle sleep; the state stream is a
  CurrentValueSubject so a late subscriber replays the terminal state — no
  lost-wakeup race, `await outcomeTask` is the join.

Added a test-only `onExecuteRequest` join seam to TPPRequestExecutorMock
(fires synchronously as executeRequest records a URL; cleared in reset()).

**Scope:** test-only. Zero production LOC changed — all edits under
PalaceTests/. The sign-in test is money-path but its production path
(logIn/awaitReadyThenRetryLogIn) is untouched; only the mock and the test's
wait mechanism changed, and the prod-behavior assertions (request fires,
carries /patrons/me) are preserved.
**Not done:** did not touch SignInWebSheetIntegrationTests (real WKWebView
cold-start, already documented FLAKE-003-OK — env-bound, not a deadline poll).
**Deferred:** none.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(catalog): de-flake parallel-starvation deadline polls via work-unit joins

CI runs PalaceTests with sim-clone oversubscription; tests that waited on a
fire-and-forget async op (Task.detached refresh, load()'s currentLoadTask) via
a fixed wall-clock deadline (awaitCondition / fulfillment(timeout:) / Task.sleep
poll) starved past the 120s executionTimeAllowance. Fix: join the actual work
unit instead of polling a deadline.

CatalogCacheKeyAndIsolationTests:
  - testConcurrentStaleReads_AcrossDistinctURLs_EachURLGetsItsOwnRefresh — join
    all 3 concurrent .utility refreshes via _awaitAllBackgroundRefreshesForTesting
  - testConcurrentStaleReads_BackgroundRefreshDoesNotPoisonNeighborKey — join the
    single refresh via _awaitBackgroundRefreshForTesting
  - testInMemoryCache_AfterSystemMemoryWarning_... + testMemoryWarning_ClearsBoth
    — handler evicts synchronously under NotificationCenter.post; assert directly
  - removed the now-orphaned awaitCondition wall-clock poll helper
CatalogDomainTests: dropped two stale "give cache queue time" Task.sleep(100ms)
  waits — invalidateCache is a synchronous lock mutation (no queue since the SWR
  refactor).
CatalogViewModelTests: 8 sites (load error/nil/offline, forceRefresh, SWR A→B→A
  waitUntilLoaded) now join currentLoadTask via _awaitLoadForTesting. Reconnect
  auto-reload left as a bounded observable-effect poll (documented un-joinable:
  the reload hops through two untracked bare Tasks off the reachability
  publisher).
SideloadedLaneTests: awaitLoaded/awaitFailure join currentLoadTask instead of a
  20s $state fulfillment.

Production seams (additive, behavior-identical, gated/defaulted — prod path
unchanged):
  - CatalogRepository._trackRefreshTasksForTesting() +
    _awaitAllBackgroundRefreshesForTesting() (refreshTracking flag defaults off;
    prod never appends/grows the tracked-task array)
  - CatalogViewModel._awaitLoadForTesting() (reads the already-retained
    currentLoadTask handle)

No assertions weakened; no XCTSkip, no raised executionTimeAllowance, no disabled
parallelism. Both production files pass `swiftc -parse`.

**Scope:** test-only de-flake batch (CATALOG). Prod change is 2 files / 66 LOC,
all additive underscore-prefixed test seams + doc comments — zero runtime
behavior change on any production path (new tracking is opt-in and defaults off;
the load seam only reads an existing handle). No money-path (borrow/DRM/sign-in)
code touched. Not done: the reconnect-auto-reload connectivity-publisher hop
still lacks a retained-handle join seam (deferred to the connectivity owner);
its test keeps a bounded observable-effect poll.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(deflake): join fire-and-forget async work instead of polling wall-clock deadlines (ACCOUNTS/PLATFORM batch)

De-flakes fixed-deadline polls that starve under CI sim-clone oversubscription
(2 clones on a small runner) and blow the 120s executionTimeAllowance. Every
change replaces a wall-clock deadline (Task.sleep-then-assert, RunLoop.run(until:)
spin, tight fulfillment ceiling) with a deterministic JOIN on the actual work.

Test-side conversions:
- AppLaunchTracker{,Extended}Tests: join the fire-and-forget catalogLoaded metrics
  report via new tracker.awaitPendingMetricsReport() seam (was: sleep 100/200ms).
- AppHealthViewModelTests: join loadData() via new viewModel.awaitLoadForTesting()
  seam (was: 5× sleep 200ms); offline-queue status update now joins the ViewModel's
  main-hopped $offlineQueueStatus sink via fulfillment (was: sleep 200ms).
- AccountStateMachineTests.testStateStream_emitsCurrentThenTransitions: subscription
  barrier on the stream's first (CurrentValueSubject current-value) emission before
  driving transitions (was: 2× sleep 30ms; genuine intermediate-state ordering hazard).
- AppContainerResetTests: join presenter $hasActiveSession @published emission (was:
  2s RunLoop.main.run(until:) spin).
- AccountDetailViewModelTests: settle() joins $isLoadingAuth reaching false (was:
  yield×3 + sleep 50ms).
- ViewModelComputedPropertyTests: drainMainQueueAsync() for the other-book no-react
  case (was: sleep 200ms).
- ActiveSessionsViewModelTests: widen 3 genuine-join fulfillment ceilings 0.5s->5.0s
  to match the already-fixed site 185 precedent (join mechanism unchanged; only the
  failure-bound widened so a real join can't starve under oversubscription).

Production seams (test-only join points, behavior-identical in production):
- AppLaunchTracker: retain the metrics-report Task in metricsReportTask + expose
  awaitPendingMetricsReport(). Same task still runs detached; we only keep its handle.
- AppHealthViewModel: retain the loadData() Task in loadTask + expose
  awaitLoadForTesting(). Same task still runs; we only keep its handle.

No assertions weakened; no XCTSkip; no disabled parallelism. Left as-is (correctly):
callback-fulfilled expectations, condition-driven bounded spins (UserAccountPublisher
deinit-cancel loop, AccountsManagerCancellation suspend-point spin), negative-assertion
settle windows (AccountsManagerFirstRunDecode 0.5s no-second-decode; bounded, not a
120s risk), and awaitReady() slow-path tests (CurrentValueSubject replay makes
resolution ordering-independent). RemoteFeatureFlags 10s sleep is a withTimeout
cancellation probe, not a deadline poll.

**Scope:** 7 target test dirs (Accounts/Platform/Crawl/ViewModels/Migrations/
ImageLoading/AppInfrastructure). Crawl + Migrations had no deadline-polls. Skip-list
files (OfflineQueueService/PositionSync/Accessibility/PerformanceMonitor/
StateMachineWiring/AccountDetailsURL/PoolResponsivenessProbe) untouched.
**Not done:** no build/verify run (CI verifies per batch brief); no push/merge.
**Deferred:** none. No money/critical-path production behavior changed — the two
prod seams only retain an existing Task handle for a test join.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(reader): join fire-and-forget async instead of polling wall-clock deadlines (de-flake)

De-flakes parallel-starvation deadline-poll tests in the reader/PDF/bookmark
areas. Under CI's 2-sim-clone oversubscription, tests that waited a FIXED
wall-clock interval (Task.sleep / debounce-deadline poll) for a fire-and-forget
async op could starve past the deadline and hit the 120s executionTimeAllowance.
Fix: JOIN the actual work via retained-Task seams / a persist-completion signal
instead of racing a deadline. Also fixes one shared-state root (mock defaulting
to the production singleton registry).

Prod seams added (all behavior-identical; nil/uncalled in production):
- TPPLastReadPositionPoster: retain spawned server-post Tasks + awaitPendingWrites()
- TPPReaderTOCBusinessLogic: retain the init TOC-load Task + awaitTOCLoad()
- TypographyService: onDidPersistForTesting callback fired after each debounced persist

Shared-state root fixed:
- MockPDFDocumentMetadata now injects an isolated TPPBookRegistryMock per instance
  instead of letting the parent init default to AppContainer.production().bookRegistry
  (every mock was touching the shared singleton — cross-test pollution). Behavior
  the tests assert (bookmark-set membership) is unchanged.

Tests converted from deadline-polls to deterministic joins:
- TPPLastReadPositionPosterTests (5 Task.sleep -> awaitPendingWrites)
- TPPReaderTOCBusinessLogicTests (4 XCTNSPredicate 10s polls -> awaitTOCLoad)
- TypographyServiceTests.testSettingsPersistedAfterDebounce (predicate poll -> persist-signal join)

No assertions weakened; no XCTSkip/raised allowances/loosened asserts.

**Scope:** Reader2/PDF/Bookmark de-flake only. Left genuine event-driven waits
untouched (spy-navigator/completion-fulfilled expectations, count-matched
concurrency joins, main-actor-drain barriers) — those already join real work.
**Not done:** TypographyServiceIntegrationTests.swift is present in the project
group but NOT compiled (no PBXSourcesBuildPhase entry; references a
TypographyPersistence protocol that does not exist in prod) — its debounce
Task.sleep polls are inert (never run in CI), so left as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(audiobooks): de-flake parallel-starvation deadline-poll waits (swarm AUDIOBOOK)

CI runs PalaceTests with 2 sim clones on a small runner; tests that wait for
a fire-and-forget async op via a FIXED WALL-CLOCK deadline starve under
oversubscription and hit the 120s executionTimeAllowance. This converts those
waits to deterministic JOINS of the actual work unit.

Fixed:
- AudiobookBookmarkBusinessLogic{,PositionWrite}Tests: position-write detached
  Task now joined via a new `_awaitPositionWriteForTesting()` seam (retained
  Task-handle) instead of `wait(for:timeout:)` on the completion.
- NowPlayingCoordinator{,Background}Tests: debounced `Task.sleep` update now
  joined via a new `_awaitPendingUpdateForTesting()` seam instead of
  `awaitCondition(timeout:5)` polling MPNowPlayingInfoCenter.
- AudiobookSessionPresenterTests: replaced the fixed-50ms
  `RunLoop.main.run(until:)` publisher-delivery spin with the deterministic
  FIFO `drainMainQueue()` (16 sites via the shared helper).
- AudiobookDataManagerSyncTests: mock POST completions moved off
  `.global().asyncAfter` onto a serial completion queue + `drainCompletions()`
  barrier; predicate-poll expectations replaced with `syncQueue.sync {}` +
  `drainCompletions()` joins.

Production seams added are underscore-prefixed, test-only, and behavior-
identical (no production call path invokes them; the write Task runs exactly
as before, only its handle is now retained).

Left as-is (genuine event-joins / un-joinable, noted): AudiobookLoader{,Dispatch,
OPDSShapeMatrix}Tests + vendor adapter tests (real AppContainer.production()
pipeline / @MainActor-Task hops driven by runloop spin, no clean seam without
a DRM-path refactor); AudiobookOpenStateRace / FirstOpenHang (event-firing
gate waits); AudioEngineWrapper / LoaderFinalizeBuild (synchronous completions);
the debounce-dealloc crash-survival test (no work unit to await by design).

**Scope:** test-only de-flake + two underscore-prefixed test-join seams on
AudiobookBookmarkBusinessLogic + NowPlayingCoordinator. No behavior change.
**Not done:** vendor-adapter (LCP/Bearer/OpenAccess) and AudiobookLoader Task
joins — those hit the real fulfillment/DRM pipeline and warrant a swarm, not a
lone seam; left with inline reasoning.
**Deferred:** none.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(mybooks): de-flake return/auth/fulfillment deadline-poll waits (join, don't poll)

Convert wall-clock deadline-polls on fire-and-forget async to deterministic
joins across the return / auth / download-fulfillment money-path tests. Under
CI oversubscription (2 sim clones, small runner) these polls
(awaitConditionAsync / Task.sleep loops / asyncAfter+wait / while-Date loops)
starve and hit the 120s executionTimeAllowance.

Join patterns used:
- Retained-Task join: await inFlightTasksSnapshotForTesting() Task.value
  (BookReturnService + DownloadAuthRetryHandler both retain their fire-and-
  forget Tasks; the auto-removal is the tail of each tracked body, so
  await task.value joins body+cleanup deterministically).
- Synchronous retention insert -> direct assert (returnBook / handleAuth insert
  the tracked Task synchronously before returning; count is deterministically
  >=1 with no poll).
- Prompt-firing expectation: fulfil an XCTestExpectation from the effect edge
  (error-publisher sink, reauthenticator.onAuthenticate, delegate.onStartDownload)
  instead of polling a captured-array count behind a fixed asyncAfter delay.
- Main-actor barrier flush (await Task { @mainactor }.value) for all-@mainactor
  chains and absence-assertions, replacing fixed settle sleeps.

Prod seam added (test-only behavior, behavior-identical):
- DownloadAuthRetryHandler.inFlightTasksSnapshotForTesting() — a @mainactor
  read-only copy of the existing inFlightTasks set, mirroring the established
  BookReturnService seam. Mutates nothing; no production path changes.

Un-joinable sites left with an inline note + kept as loud-on-timeout waits (no
retention handle available without a larger prod change):
- BookSignInRedirectHandler SAML-cookies-expired retry (background Task { }).
- LCPFulfillmentHandler stored-fulfillment-task (untracked Task in a void method).
- BookReturnService deinit observation (ARC last-release, not awaitable).
- TokenRefreshInterceptor coordinator paths — barrier-flush (no retention seam
  on the interceptor yet; flagged as the complete follow-up).

No assertions weakened; no XCTSkip; no raised allowances; parallelism untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(mybooks): de-flake download/borrow/registry deadline-poll waits (join, don't poll)

Convert fixed-wall-clock deadline polls (awaitCondition / awaitConditionAsync /
Task.sleep loops / RunLoop.run(until:)) that waited on fire-and-forget async
work into deterministic joins. Under CI oversubscription (2 sim clones) those
polls starve and blow the 120s executionTimeAllowance; joining the actual work
removes the wall-clock race entirely.

Test-side: await the SUT's own async entry points / retained-Task seams,
drain-then-assert for synchronous registry+notification effects, and use
prompt-firing NotificationCenter expectations (fulfilled by the SUT's own
post) in place of RunLoop deadline polls. Publisher joins via a shared
awaitPublished/awaitPublishedAsync helper.

Prod: add behavior-identical join seams only — fire-and-forget `Task {}` bodies
extracted verbatim into `...Async()` siblings whose sync wrapper is
`Task { await ...Async() }` (enqueuePendingAsync, startBorrowAsync,
limitActiveDownloadsAsync, pauseAllDownloadsAsync, processAsync), plus
retained-Task `private(set) var last...Task` handles for tests to await. Same
calls, same order, same side effects; no logic, branch, or state-transition
change. Mirrors the existing schedulePendingStartsIfPossible→Async split.

No assertions weakened, no XCTSkip, no raised allowance, parallelism untouched.

**Scope:** de-flake pass over PalaceTests/MyBooks, PalaceTests/Book,
PalaceTests/BookStateManagement (return/auth/fulfillment slice committed
separately in the preceding commit). Prod seams are money-path
(borrow/download) and confirmed test-only-behavior (behavior-identical joins).
**Deferred:** a full retention seam for TokenRefreshInterceptor's ~20
fire-and-forget Task sites (too broad for a de-flake pass; two interceptor
poll sites left with UNJOINABLE notes). Genuinely un-joinable sites (real
debounce timers, ARC-deinit observation, absence-of-effect settles, SAML
retry background Tasks with no handle) left in place with inline UNJOINABLE
notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(deflake): add #1315's SignOut/MultiLibrary joins the swarm skipped

The full-sweep swarm branched off develop (which lacked #1315), so its Network
batch skipped TPPSignInBusinessLogicSignOutTests + MultiLibraryTokenIsolationTests
believing they were already on develop. They were only in #1315. Bring those two
join fixes + the TPPDRMAuthorizingMock._awaitDeauthorizeCalledForTesting seam they
need, so the sweep supersedes #1315 completely (BorrowOperationContractTests kept
from the mybooks batch, which fixed the whole Borrow slice).

**Scope:** test-only (2 test files + 1 test mock); no production change here.

* fix(deflake): sync poster join seam (avoid Swift 6 sending self.poster)

The reader batch's `awaitPendingWrites() async` seam, called on the @mainactor
test's non-Sendable poster, tripped Swift 6 'sending self.poster'. Reshaped to a
synchronous `pendingWriteTasksForTesting() -> [Task]` snapshot (a sync call sends
nothing; Task is Sendable) and the test awaits the returned handles. Behavior
identical; consolidated sweep now builds clean.

**Scope:** compile fix for the consolidated de-flake sweep; no behavior change.

* revert(deflake): restore DownloadAuthRetryHandler de-flake to develop (broke behavior)

The mybooks batch's join conversion of DownloadAuthRetryHandlerTests asserted
before the alert-publish/retry-download effect landed → 2 deterministic failures
(testAutoBorrowCompletion_whenBorrowFails, testHandle_401_withoutCredentials).
This class's async structure was flagged partial/complex; reverting its de-flake
(+ the prod seam) to develop's correct version is safer than shipping a broken
money-path join. The class may still occasionally flake under parallel load
(pre-existing) — that's a separate, non-regressing follow-up.

**Scope:** revert 3 files to develop; rest of the sweep unchanged.

---------

Co-authored-by: t <t@t.io>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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