Skip to content

Commit

Permalink
[Darwin] Reduce the tests timeout from 10 seconds to 3 (#6415)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Jul 3, 2021
1 parent 4d9dfd8 commit 1110674
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 182 deletions.
16 changes: 11 additions & 5 deletions src/darwin/Framework/CHIP/templates/clusters-tests.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
// system dependencies
#import <XCTest/XCTest.h>

const uint16_t kTimeoutInMs = 10;
const uint16_t kPairingTimeoutInSeconds = 10;
const uint16_t kTimeoutInSeconds = 3;
const uint64_t kDeviceId = 1;
const uint16_t kDiscriminator = 3840;
const uint32_t kSetupPINCode = 20202021;
Expand Down Expand Up @@ -75,6 +76,11 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId)

@implementation CHIPClustersTests

- (void)setUp {
[super setUp];
[self setContinueAfterFailure:NO];
}

- (void)testInitStack
{
XCTestExpectation * expectation = [self expectationWithDescription:@"Pairing Complete"];
Expand All @@ -100,7 +106,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId)
error:&error];
XCTAssertEqual(error.code, 0);

[self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil];
[self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil];
}

- (void)testShutdownStack
Expand Down Expand Up @@ -134,7 +140,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId)
[expectation fulfill];
}];

[self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
{{/unless}}
{{/chip_server_cluster_commands}}
Expand All @@ -157,7 +163,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId)
[expectation fulfill];
}];

[self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}

{{#if (isWritableAttribute)}}
Expand All @@ -177,7 +183,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId)
[expectation fulfill];
}];

[self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil];
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
}
{{/if}}
{{/chip_server_cluster_attributes}}
Expand Down
Loading

0 comments on commit 1110674

Please sign in to comment.