From 56f6f5a0a07cb163d866fb319e7e63eb18debcaf Mon Sep 17 00:00:00 2001 From: Michael Grosse Huelsewiesche Date: Fri, 22 Nov 2024 13:18:38 -0500 Subject: [PATCH] Fixing test --- Sources/Segment/Utilities/Telemetry.swift | 2 +- Tests/Segment-Tests/Telemetry_Tests.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Segment/Utilities/Telemetry.swift b/Sources/Segment/Utilities/Telemetry.swift index 4836c3a..53eb0a8 100644 --- a/Sources/Segment/Utilities/Telemetry.swift +++ b/Sources/Segment/Utilities/Telemetry.swift @@ -89,7 +89,7 @@ public class Telemetry: Subscriber { private var seenErrors = [String: Int]() internal var started = false private var rateLimitEndTime: TimeInterval = 0 - private var flushFirstError = true + internal var flushFirstError = true private var telemetryQueue = DispatchQueue(label: "telemetryQueue") private var updateQueue = DispatchQueue(label: "updateQueue") private var telemetryTimer: QueueTimer? diff --git a/Tests/Segment-Tests/Telemetry_Tests.swift b/Tests/Segment-Tests/Telemetry_Tests.swift index a182b33..9097fbd 100644 --- a/Tests/Segment-Tests/Telemetry_Tests.swift +++ b/Tests/Segment-Tests/Telemetry_Tests.swift @@ -116,6 +116,7 @@ class TelemetryTests: XCTestCase { func testHTTPException() { mockTelemetryHTTPClient(shouldThrow: true) + Telemetry.shared.flushFirstError = true Telemetry.shared.enable = true Telemetry.shared.start() Telemetry.shared.error(metric: Telemetry.INVOKE_METRIC, log: "log") { $0["error"] = "test" }