Skip to content

Commit 452b2c4

Browse files
fix: Flake unit tests (#459)
**Requirements** - [ ] I have added test coverage for new or changed functionality - [ ] I have followed the repository's [pull request submission guidelines](../blob/v9/CONTRIBUTING.md#submitting-pull-requests) - [ ] I have validated my changes against all supported platform versions **Related issues** Provide links to any issues in this repository or elsewhere relating to this pull request. **Describe the solution you've provided** Fix flake unit tests of Throttler **Describe alternatives you've considered** Provide a clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context about the pull request here. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Raises minimum platform versions and introduces `TimeoutExecutor`, used by `LDClient.identify` and `LDClient.start` for single-fire timeouts; updates tests and docs accordingly. > > - **Core SDK**: > - Add `ServiceObjects/TimeoutExecutor.swift` and use it in `LDClient.identify(..., timeout:)` and `LDClient.start(..., startWaitSeconds:)` to ensure single, deterministic timeout completions. > - **Tests**: > - Add `TimeoutExecutorSpec` and wire into Xcode project. > - Tweak `ThrottlerSpec` to remove flaky expectations. > - **Build/Platforms**: > - Bump Swift tools to `5.5` (`Package.swift`). > - Raise deployment targets: `iOS 13`, `watchOS 6`, `tvOS 13`, `macOS 12` (SPM, CocoaPods, Xcode project settings). > - **Docs**: > - Update `CHANGELOG.md` and `README.md` to reflect new platform minimums and toolchain version. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 94866d8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
2 parents ae57f26 + 94866d8 commit 452b2c4

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

LaunchDarkly/LaunchDarklyTests/ServiceObjects/ThrottlerSpec.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ final class ThrottlerSpec: QuickSpec {
105105
// First two run immediate
106106
throttler.runThrottled { }
107107
throttler.runThrottled { }
108-
expect(throttler.safeRunAttempts) == 1
109108
let callDate = Date()
110109
var runDate: Date?
111110
waitUntil(timeout: .seconds(3)) { done in
@@ -165,7 +164,6 @@ final class ThrottlerSpec: QuickSpec {
165164
hasRun = true
166165
}
167166
throttler.cancelThrottledRun()
168-
expect(throttler.safeRunAttempts) == 2
169167
expect(throttler.workItem).to(beNil())
170168
// Wait until run would have occured
171169
Thread.sleep(forTimeInterval: 1.0)

0 commit comments

Comments
 (0)