Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Mar 6, 2024
1 parent f4ba264 commit f71efa4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/LiveKitTests/SerialRunnerActor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class AsyncSerialExecutorTests: XCTestCase {
var serialExecutor1Counter: Int = 0
let serialExecutor1 = SerialRunnerActor<Void>()

// Test whether tasks, when invoked concurrently, continue to run in a serial manner.
// Access to the counter value should be synchronized, aiming for a final count of 0.
func testSerialExecution() async throws {
// Run Tasks concurrently
try await withThrowingTaskGroup(of: Void.self) { group in
Expand All @@ -46,6 +48,8 @@ class AsyncSerialExecutorTests: XCTestCase {
XCTAssert(serialExecutor1Counter == 0)
}

// Test whether tasks invoked concurrently, and randomly cancelled, continue to run in a serial manner.
// Access to the counter value should be synchronized, resulting in a count of 0.
func testSerialExecutionCancel() async throws {
// Run Tasks concurrently
await withTaskGroup(of: Void.self) { group in
Expand Down

0 comments on commit f71efa4

Please sign in to comment.