Skip to content

Commit

Permalink
Fix more random Darwin test failures due to timing dependency. (#34210)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Aug 19, 2024
1 parent 3f2dc67 commit 9956441
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ class MTRSwiftDeviceTestDelegate : NSObject, MTRDeviceDelegate {
return 2; // seconds
}

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

class MTRSwiftDeviceTests : XCTestCase {
Expand Down

0 comments on commit 9956441

Please sign in to comment.