Skip to content

Commit 76d68c1

Browse files
authoredJul 5, 2024
Fix more random Darwin test failures due to timing dependency. (#34210)
The fix in #33761 only fixed the Objective-C version of the test. The Swift version would still fail if it took longer than 10s to set up a subscription.
1 parent 54d2aaa commit 76d68c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift

+8
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ class MTRSwiftDeviceTestDelegate : NSObject, MTRDeviceDelegate {
9292
return 2; // seconds
9393
}
9494

95+
@objc func unitTestSuppressTimeBasedReachabilityChanges(_ device : MTRDevice) -> Bool
96+
{
97+
// Allowing time-based reachability changes just makes the tests
98+
// non-deterministic and can lead to random failures. Suppress them
99+
// unconditionally for now. If we ever add tests that try to exercise that
100+
// codepath, we can make this configurable.
101+
return true;
102+
}
95103
}
96104

97105
class MTRSwiftDeviceTests : XCTestCase {

0 commit comments

Comments
 (0)