Skip to content

Commit d0b76d8

Browse files
committed
Try to fix CLSLogQueueTests
1 parent 99dafa7 commit d0b76d8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/TecoCLSLogging/CLSLogQueue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class CLSLogQueue {
3838
let errorStorageLock = NIOLock()
3939
let errorStorage: UnsafeMutableTransferBox<Error?> = .init(nil)
4040
let continuation = DispatchWorkItem {}
41-
Task.detached {
41+
Task {
4242
do {
4343
while let payload = self.batchUploadPayload(force: true) {
4444
_ = try await self.uploader(payload)

Tests/TecoCLSLoggingTests/CLSLogQueueTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import AsyncHTTPClient
44
import Atomics
55

66
final class CLSLogQueueTests: XCTestCase {
7-
func testBatchSize() async throws {
7+
func testBatchSize() throws {
88
// set up test helpers
99
let batches = ManagedAtomic(0)
1010
func upload(_ logs: [Cls_LogGroup]) throws -> String {
1111
XCTAssertLessThanOrEqual(logs.count, 2)
12-
batches.wrappingIncrement(ordering: .relaxed)
12+
batches.wrappingIncrement(ordering: .sequentiallyConsistent)
1313
return "mock-upload-id"
1414
}
1515

@@ -29,7 +29,7 @@ final class CLSLogQueueTests: XCTestCase {
2929
try queue.forceFlush()
3030

3131
// assert batch counts
32-
XCTAssertEqual(batches.load(ordering: .acquiring), 6)
32+
XCTAssertEqual(batches.load(ordering: .sequentiallyConsistent), 6)
3333
}
3434

3535
func testWaitDuration() async throws {

0 commit comments

Comments
 (0)