Skip to content

Commit f795ea4

Browse files
committed
put tests back like they were
1 parent 1f59e94 commit f795ea4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Tests/Segment-Tests/StressTests.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ class StressTests: XCTestCase {
2828
guard URLProtocol.registerClass(BlockNetworkCalls.self) else { XCTFail(); return }
2929

3030
let analytics = Analytics(configuration: Configuration(writeKey: "stressTest2")
31-
/*.errorHandler({ error in
31+
.errorHandler({ error in
3232
XCTFail("Storage Error: \(error)")
33-
})*/
33+
})
3434
.httpSession(RestrictedHTTPSession())
3535
)
36+
analytics.purgeStorage()
3637
analytics.storage.hardReset(doYouKnowHowToUseThis: true)
3738

3839
DirectoryStore.fileValidator = { url in
@@ -102,11 +103,12 @@ class StressTests: XCTestCase {
102103
guard URLProtocol.registerClass(BlockNetworkCalls.self) else { XCTFail(); return }
103104

104105
let analytics = Analytics(configuration: Configuration(writeKey: "stressTest2")
105-
/*.errorHandler({ error in
106+
.errorHandler({ error in
106107
XCTFail("Storage Error: \(error)")
107-
})*/
108+
})
108109
.httpSession(RestrictedHTTPSession())
109110
)
111+
analytics.purgeStorage()
110112
analytics.storage.hardReset(doYouKnowHowToUseThis: true)
111113

112114
DirectoryStore.fileValidator = { url in

Tests/Segment-Tests/Support/TestUtilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ extension XCTestCase {
178178

179179
func waitUntilFinished(analytics: Analytics?, file: StaticString = #filePath, line: UInt = #line) {
180180
addTeardownBlock { [weak analytics] in
181-
let instance = try await waitForTaskCompletion(withTimeoutInSeconds: 30) {
181+
let instance = try await waitForTaskCompletion(withTimeoutInSeconds: 3) {
182182
while analytics != nil {
183183
DispatchQueue.main.sync {
184184
RunLoop.current.run(until: .distantPast)

0 commit comments

Comments
 (0)