Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove racy Darwin test. #33594

Merged
merged 1 commit into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -1452,12 +1452,9 @@ - (void)doDataStoreMTRDeviceTestWithStorageDelegate:(id<MTRDeviceControllerStora
// datastore) the device has no estimate for subscription latency.
XCTAssertNil(device.estimatedSubscriptionLatency);

__auto_type * beforeSetDelegate = [NSDate now];

[device setDelegate:delegate queue:queue];

[self waitForExpectations:@[ subscriptionExpectation ] timeout:60];
__auto_type * afterInitialSubscription = [NSDate now];

if (!disableStorageBehaviorOptimization) {
[self waitForExpectations:@[ gotClusterDataPersisted ] timeout:60];
Expand Down Expand Up @@ -1504,14 +1501,6 @@ - (void)doDataStoreMTRDeviceTestWithStorageDelegate:(id<MTRDeviceControllerStora
// some time.
XCTAssertGreaterThan(device.estimatedSubscriptionLatency.doubleValue, 0);

// Check that this estimate is no larger than the measured latency observed
// above. Unfortunately, We measure our observed latency to report end, not
// to the immediately following internal subscription established
// notification, so in fact our measured value can end up shorter than the
// estimated latency the device has. Add some slop to handle that.
const NSTimeInterval timingSlopInSeconds = 0.5;
XCTAssertLessThanOrEqual(device.estimatedSubscriptionLatency.doubleValue, [afterInitialSubscription timeIntervalSinceDate:beforeSetDelegate] + timingSlopInSeconds);

// Now set up new delegate for the new device and verify that once subscription reestablishes, the data version filter loaded from storage will work
__auto_type * newDelegate = [[MTRDeviceTestDelegate alloc] init];

Expand Down
Loading