From a5a7ecc54e54379af10152141ed81bab517f9a19 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Mon, 13 May 2024 09:51:04 -0700 Subject: [PATCH] wait for flushes to finish out ... --- Tests/Segment-Tests/StressTests.swift | 5 +++++ 1 file changed, 5 insertions(+) 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() }