-
Notifications
You must be signed in to change notification settings - Fork 18
Fix flaky tests and Swift Testing usage #621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… in Fastlane file For new iOS `Testing` framework [Solution](fastlane/fastlane#22088 (comment))
…sts` taget Because of Swift Testing usage
Added `@discardableResult` for `Configurable` for decoding configs
`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.
[InappRemainingTargetingTests failed](https://github.com/mindbox-cloud/ios-sdk/actions/runs/19544868275/job/55966241110?pr=622)
Vailence
approved these changes
Nov 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Flaky and new Testing framework. Up iOS minimum deployment target to 13.0 for MindboxTests taget