@@ -2597,20 +2597,17 @@ - (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize deviceOnb
2597
2597
2598
2598
// Create the base device to attempt to read from the 5th device
2599
2599
__auto_type * baseDeviceReadExpectation = [self expectationWithDescription: @" BaseDevice read" ];
2600
- // Dispatch async to get around XCTest, so that this runs after the above devices queue their subscriptions
2601
- dispatch_async (queue, ^{
2602
- __auto_type * baseDevice = [MTRBaseDevice deviceWithNodeID: @(105 ) controller: controller];
2603
- __auto_type * onOffCluster = [[MTRBaseClusterOnOff alloc ] initWithDevice: baseDevice endpointID: @(1 ) queue: queue];
2604
- [onOffCluster readAttributeOnOffWithCompletion: ^(NSNumber * value, NSError * _Nullable error) {
2605
- XCTAssertNil (error);
2606
- // We expect the device to be off.
2607
- XCTAssertEqualObjects (value, @(0 ));
2608
- [baseDeviceReadExpectation fulfill ];
2609
- os_unfair_lock_lock (&counterLock);
2610
- baseDeviceReadCompleted = YES ;
2611
- os_unfair_lock_unlock (&counterLock);
2612
- }];
2613
- });
2600
+ __auto_type * baseDevice = [MTRBaseDevice deviceWithNodeID: @(105 ) controller: controller];
2601
+ __auto_type * onOffCluster = [[MTRBaseClusterOnOff alloc ] initWithDevice: baseDevice endpointID: @(1 ) queue: queue];
2602
+ [onOffCluster readAttributeOnOffWithCompletion: ^(NSNumber * value, NSError * _Nullable error) {
2603
+ XCTAssertNil (error);
2604
+ // We expect the device to be off.
2605
+ XCTAssertEqualObjects (value, @(0 ));
2606
+ [baseDeviceReadExpectation fulfill ];
2607
+ os_unfair_lock_lock (&counterLock);
2608
+ baseDeviceReadCompleted = YES ;
2609
+ os_unfair_lock_unlock (&counterLock);
2610
+ }];
2614
2611
2615
2612
// Make the wait time depend on pool size and device count (can expand number of devices in the future)
2616
2613
NSArray * expectationsToWait = [subscriptionExpectations.allValues arrayByAddingObject: baseDeviceReadExpectation];
0 commit comments