Skip to content

Conversation

@justSmK
Copy link
Contributor

@justSmK justSmK commented Nov 20, 2025

Flaky and new Testing framework. Up iOS minimum deployment target to 13.0 for MindboxTests taget

@justSmK justSmK requested a review from Vailence November 20, 2025 11:37
`testFailureAndRetryScheduleByTimer` was asserting an exact sequence of `GuaranteedDeliveryManager.State` values and relied on an `NSPredicate`-based expectation that checked both the manager state and the fake database contents. On slow or loaded CI these timing assumptions could easily be violated, causing intermittent timeouts or order mismatches.

This change makes the test resilient to timing and scheduling details:
- Replace `XCTNSPredicateExpectation` with a simple `XCTestExpectation` that is fulfilled when the manager reaches `.idle` after:
  - observing at least two `.delivering` states (initial delivery + retry)
  - observing at least one `.waitingForRetry` state.
- Stop enforcing an exact state order; instead, assert aggregated behavior based on the recorded state transitions.
- Remove the dependency on fakeDB.countEvents() from the async wait  condition (the database is still populated and used by the manager, but  we no longer block the test on a specific empty-at-exact-moment check).

As a result, the test still verifies that a failed delivery is retried and the manager eventually returns to `.idle`, but it no longer flakes due to timing-sensitive expectations.
@justSmK justSmK merged commit c32361b into develop Nov 21, 2025
5 checks passed
@justSmK justSmK deleted the fix-flaky-tests branch November 21, 2025 14:48
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.

3 participants