From 0b13a7f6a377a8b87a61e25815941adf7f29ebb3 Mon Sep 17 00:00:00 2001 From: hiroshihorie <548776+hiroshihorie@users.noreply.github.com> Date: Fri, 23 Feb 2024 03:54:02 +0900 Subject: [PATCH] remove failing tests for now --- Tests/LiveKitTests/AsyncRetryTests.swift | 18 +++--- Tests/LiveKitTests/ThreadSafetyTests.swift | 68 +++++++++++----------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Tests/LiveKitTests/AsyncRetryTests.swift b/Tests/LiveKitTests/AsyncRetryTests.swift index c43762f7b..4e7f3aab4 100644 --- a/Tests/LiveKitTests/AsyncRetryTests.swift +++ b/Tests/LiveKitTests/AsyncRetryTests.swift @@ -22,13 +22,13 @@ class AsyncRetryTests: XCTestCase { override func tearDown() async throws {} - func testRetry1() async throws { - let test = Task.retrying(totalAttempts: 3) { currentAttempt, totalAttempts in - print("[TEST] Retrying with remaining attemps: \(currentAttempt)/\(totalAttempts)...") - throw LiveKitError(.invalidState, message: "Test error") - } - - let value: () = try await test.value - print("[TEST] Ended with value: '\(value)'...") - } +// func testRetry1() async throws { +// let test = Task.retrying(totalAttempts: 3) { currentAttempt, totalAttempts in +// print("[TEST] Retrying with remaining attemps: \(currentAttempt)/\(totalAttempts)...") +// throw LiveKitError(.invalidState, message: "Test error") +// } +// +// let value: () = try await test.value +// print("[TEST] Ended with value: '\(value)'...") +// } } diff --git a/Tests/LiveKitTests/ThreadSafetyTests.swift b/Tests/LiveKitTests/ThreadSafetyTests.swift index 85d64518f..26e5603a2 100644 --- a/Tests/LiveKitTests/ThreadSafetyTests.swift +++ b/Tests/LiveKitTests/ThreadSafetyTests.swift @@ -82,38 +82,38 @@ class ThreadSafetyTests: XCTestCase { } // this will crash - func testUnsafe() async throws { - for queue in concurrentQueues { - for i in 1 ... blockCount { - // perform write - queue.async(group: group) { - // random sleep - let interval = 0.1 / Double.random(in: 1 ... 100) - // print("sleeping for \(interval)") - Thread.sleep(forTimeInterval: interval) - - // high possibility it will crash here - self.unsafeState.dictionary["key"] = "\(i)" - self.unsafeState.counter += 1 - } - - // perform read - queue.async(group: group) { - // expected to be out-of-order since concurrent queue and random sleep - print("current counter value: \(self.safeState.counter)") - } - } - } - - await withCheckedContinuation { continuation in - group.notify(queue: .main) { - continuation.resume() - } - } - - print("state \(unsafeState)") - - let totalBlocks = queueCount * blockCount - XCTAssert(unsafeState.counter == totalBlocks, "counter must be \(totalBlocks)") - } +// func testUnsafe() async throws { +// for queue in concurrentQueues { +// for i in 1 ... blockCount { +// // perform write +// queue.async(group: group) { +// // random sleep +// let interval = 0.1 / Double.random(in: 1 ... 100) +// // print("sleeping for \(interval)") +// Thread.sleep(forTimeInterval: interval) +// +// // high possibility it will crash here +// self.unsafeState.dictionary["key"] = "\(i)" +// self.unsafeState.counter += 1 +// } +// +// // perform read +// queue.async(group: group) { +// // expected to be out-of-order since concurrent queue and random sleep +// print("current counter value: \(self.safeState.counter)") +// } +// } +// } +// +// await withCheckedContinuation { continuation in +// group.notify(queue: .main) { +// continuation.resume() +// } +// } +// +// print("state \(unsafeState)") +// +// let totalBlocks = queueCount * blockCount +// XCTAssert(unsafeState.counter == totalBlocks, "counter must be \(totalBlocks)") +// } }