File tree 1 file changed +4
-3
lines changed
src/darwin/Framework/CHIPTests
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -508,10 +508,12 @@ - (void)testItemsConcurrently
508
508
}
509
509
os_unfair_lock_unlock (&counterLock);
510
510
sleep (1 );
511
+ os_unfair_lock_lock (&counterLock);
511
512
afterSleepCounter++;
512
513
if (afterSleepCounter == 3 ) {
513
514
[first3WorkItemsSleptExpectation fulfill ];
514
515
}
516
+ os_unfair_lock_unlock (&counterLock);
515
517
completion (MTRAsyncWorkComplete);
516
518
};
517
519
@@ -533,9 +535,8 @@ - (void)testItemsConcurrently
533
535
workItemLast.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) {
534
536
// expect this to have waited until at least one of the above items finished after sleep() and incremented counter
535
537
os_unfair_lock_lock (&counterLock);
536
- if (afterSleepCounter > 0 ) {
537
- [lastWorkItemWaitedExpectation fulfill ];
538
- }
538
+ XCTAssert (afterSleepCounter > 0 );
539
+ [lastWorkItemWaitedExpectation fulfill ];
539
540
os_unfair_lock_unlock (&counterLock);
540
541
completion (MTRAsyncWorkComplete);
541
542
};
You can’t perform that action at this time.
0 commit comments