Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jtung-apple committed May 6, 2024
1 parent 446f1e0 commit 6356cbe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,12 @@ - (void)testItemsConcurrently
}
os_unfair_lock_unlock(&counterLock);
sleep(1);
os_unfair_lock_lock(&counterLock);
afterSleepCounter++;
if (afterSleepCounter == 3) {
[first3WorkItemsSleptExpectation fulfill];
}
os_unfair_lock_unlock(&counterLock);
completion(MTRAsyncWorkComplete);
};

Expand All @@ -533,9 +535,8 @@ - (void)testItemsConcurrently
workItemLast.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) {
// expect this to have waited until at least one of the above items finished after sleep() and incremented counter
os_unfair_lock_lock(&counterLock);
if (afterSleepCounter > 0) {
[lastWorkItemWaitedExpectation fulfill];
}
XCTAssert(afterSleepCounter > 0);
[lastWorkItemWaitedExpectation fulfill];
os_unfair_lock_unlock(&counterLock);
completion(MTRAsyncWorkComplete);
};
Expand Down

0 comments on commit 6356cbe

Please sign in to comment.