Skip to content

Commit

Permalink
Make the Darwin per-step YAML timeouts larger and configurable. (#14368)
Browse files Browse the repository at this point in the history
This makes the following changes:

1) Bumps kTimeoutInSeconds from 3 to 5.
2) For "WaitForMs" commands, sets the timeout to
   (waitTime/1000) + kTimeoutInSeconds, so longish waits work automatically.
3) Allows specifying a "stepTimeoutSecs" property in the YAML to override
   all of that and just set a value.

Fixes #14364
Fixes #14260
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jul 7, 2023
1 parent cf82517 commit 4024362
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/templates/clusters-tests.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
const uint16_t kPairingTimeoutInSeconds = 10;
const uint16_t kAddressResolveTimeoutInSeconds = 10;
const uint16_t kCASESetupTimeoutInSeconds = 30;
const uint16_t kTimeoutInSeconds = 3;
const uint16_t kTimeoutInSeconds = 5;
const uint64_t kDeviceId = 1;
const uint16_t kDiscriminator = 3840;
const uint32_t kSetupPINCode = 20202021;
Expand Down
10 changes: 9 additions & 1 deletion src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,17 @@ ResponseHandler {{> subscribeDataCallback}} = nil;

{{/if}}
{{#unless async}}
[self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil];
{{#*inline "minCommandTimeout"~}}
{{#if (isTestOnlyCluster cluster)~}}
{{#if (isStrEqual command "WaitForMs")~}}
{{#chip_tests_item_parameters}}{{#if (isStrEqual name "ms")}}({{definedValue}} / 1000) + {{/if}}{{/chip_tests_item_parameters}}
{{~/if}}
{{~/if}}
{{~/inline}}
[self waitForExpectationsWithTimeout:{{#if stepTimeoutSecs}}{{stepTimeoutSecs}}{{else}}{{> minCommandTimeout}}kTimeoutInSeconds{{/if}} handler:nil];
{{/unless}}
}
{{/chip_tests_items}}

{{/chip_tests}}

48 changes: 24 additions & 24 deletions src/darwin/Framework/CHIPTests/CHIPClustersTests.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4024362

Please sign in to comment.