Skip to content

Conversation

@justSmK
Copy link
Collaborator

@justSmK justSmK commented Nov 20, 2025

Fix run tests time Fastlane

Симулятор чуть раньше начинается запускаться, должно на капельку время простоя снизить

@justSmK justSmK requested a review from Vailence November 20, 2025 12:01
@justSmK justSmK merged commit 147f001 into fix-flaky-tests Nov 21, 2025
23 of 25 checks passed
@justSmK justSmK deleted the fix-run-tests-time branch November 21, 2025 14:22
justSmK added a commit that referenced this pull request Nov 21, 2025
* WMSDK-0000: Fix `xcodebuildFormatter` from `xcpretty` to `xcbeautify` in Fastlane file

For new iOS `Testing` framework

[Solution](fastlane/fastlane#22088 (comment))

* WMSDK-0000: Fix flaky tests - `InappScheduleManagerTests`

* WMSDK-0000: Rewrite tests `InAppResponseModelTests`

* WMSDK-0000: Up iOS minimum deployment target to `13.0` for `MindboxTests` taget

Because of Swift Testing usage

* WMSDK-0000: Rewrite `InAppResponseModelTests` from XCTest to Testing

Added `@discardableResult` for `Configurable` for decoding configs

* WMSDK-0000: Remove XCTest version of `InappConfigurationTestsXCTestCase`

* WMSDK-0000: Fix Testing tags, naming in `InappConfigurationTests`

* WMSDK-0000: Rewrite `InappScheduleManagerTests` from XCTest to Testing

* WMSDK-0000: Fix flakiness of `testFailureAndRetryScheduleByTimer`

`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.

* WMSDK-0000: Fix `test_PushTokenKeepalive_doesNotSendOperationWhenTokenFromConfigIsLessThenZero`

https://github.com/mindbox-cloud/ios-sdk/actions/runs/19536580968/job/55954396961

* WMSDK-0000: Fix `InappRemainingTargetingTests` and rewrite to Testing

[InappRemainingTargetingTests failed](https://github.com/mindbox-cloud/ios-sdk/actions/runs/19544868275/job/55966241110?pr=622)

* WMSDK-0000: Add `prelaunchSimulator` function in Fastlane file (#622)
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