diff --git a/Tests/Segment-Tests/StressTests.swift b/Tests/Segment-Tests/StressTests.swift index cc89a9d..8adbddf 100644 --- a/Tests/Segment-Tests/StressTests.swift +++ b/Tests/Segment-Tests/StressTests.swift @@ -98,6 +98,11 @@ class StressTests: XCTestCase { RunLoop.main.run(until: Date.distantPast) } + // wait for everything to settle down flush-wise... + while (analytics.hasUnsentEvents) { + RunLoop.main.run(until: Date(timeIntervalSinceNow: .seconds(5))) + } + analytics.purgeStorage() }