Skip to content

Commit 03d369c

Browse files
PatMyronkddejong
andauthored
increasing default handler timeout for cfn test (#554)
* increasing default handler timeout for cfn test #486 * clarifying cfn test --enforce-timeout in README Co-authored-by: Kevin DeJong <kddejong@amazon.com>
1 parent 1680e98 commit 03d369c

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ To run the contract tests for a resource type, use the `test` command.
5252

5353
```bash
5454
cfn test
55-
cfn test -- -k contract_delete_update #to run a single test
56-
cfn test -- --tb=long #exhaustive, informative traceback formatting
57-
cfn test --enforce-timeout 60 #set the RL handler timeout to 60 seconds and CUD handler timeout to 120 seconds.
58-
cfn test --enforce-timeout 60 -- -k contract_delete_update # combine args
55+
cfn test -- -k contract_delete_update # to run a single test
56+
cfn test -- --tb=long # exhaustive, informative traceback formatting
57+
cfn test --enforce-timeout 60 # Read/List handler timeout (Create/Update/Delete handler timeout is twice the Read/List handler timeout)
58+
cfn test --enforce-timeout 60 -- -k contract_delete_update # combine arguments
5959
cfn test --log-group-name cw_log_group --log-role-arn log_delivery_role_arn # Handler logs generated by contract tests will be delivered to the specified cw_log_group using the credentials from log_delivery_role_arn
6060
```
6161

src/rpdk/core/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
DEFAULT_ENDPOINT = "http://127.0.0.1:3001"
3434
DEFAULT_FUNCTION = "TypeFunction"
3535
DEFAULT_REGION = "us-east-1"
36-
DEFAULT_TIMEOUT = "30"
36+
DEFAULT_TIMEOUT = "240"
3737
INPUTS = "inputs"
3838

3939
RESOURCE_OVERRIDES_VALIDATOR = Draft6Validator(

tests/test_test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def create_invalid_input_file(base):
139139
@pytest.mark.parametrize(
140140
"args_in,pytest_args,plugin_args",
141141
[
142-
([], [], [DEFAULT_FUNCTION, DEFAULT_ENDPOINT, DEFAULT_REGION, "30"]),
143-
(["--endpoint", "foo"], [], [DEFAULT_FUNCTION, "foo", DEFAULT_REGION, "30"]),
142+
([], [], [DEFAULT_FUNCTION, DEFAULT_ENDPOINT, DEFAULT_REGION, "240"]),
143+
(["--endpoint", "foo"], [], [DEFAULT_FUNCTION, "foo", DEFAULT_REGION, "240"]),
144144
(
145145
["--function-name", "bar", "--enforce-timeout", "60"],
146146
[],
@@ -149,12 +149,12 @@ def create_invalid_input_file(base):
149149
(
150150
["--", "-k", "create"],
151151
["-k", "create"],
152-
[DEFAULT_FUNCTION, DEFAULT_ENDPOINT, DEFAULT_REGION, "30"],
152+
[DEFAULT_FUNCTION, DEFAULT_ENDPOINT, DEFAULT_REGION, "240"],
153153
),
154154
(
155155
["--region", "us-west-2", "--", "--collect-only"],
156156
["--collect-only"],
157-
[DEFAULT_FUNCTION, DEFAULT_ENDPOINT, "us-west-2", "30"],
157+
[DEFAULT_FUNCTION, DEFAULT_ENDPOINT, "us-west-2", "240"],
158158
),
159159
],
160160
)
@@ -220,8 +220,8 @@ def test_test_command_happy_path_resource(
220220
@pytest.mark.parametrize(
221221
"args_in,pytest_args,plugin_args",
222222
[
223-
([], [], [DEFAULT_FUNCTION, DEFAULT_ENDPOINT, DEFAULT_REGION, "30"]),
224-
(["--endpoint", "foo"], [], [DEFAULT_FUNCTION, "foo", DEFAULT_REGION, "30"]),
223+
([], [], [DEFAULT_FUNCTION, DEFAULT_ENDPOINT, DEFAULT_REGION, "240"]),
224+
(["--endpoint", "foo"], [], [DEFAULT_FUNCTION, "foo", DEFAULT_REGION, "240"]),
225225
(
226226
["--function-name", "bar", "--enforce-timeout", "60"],
227227
[],
@@ -230,12 +230,12 @@ def test_test_command_happy_path_resource(
230230
(
231231
["--", "-k", "create"],
232232
["-k", "create"],
233-
[DEFAULT_FUNCTION, DEFAULT_ENDPOINT, DEFAULT_REGION, "30"],
233+
[DEFAULT_FUNCTION, DEFAULT_ENDPOINT, DEFAULT_REGION, "240"],
234234
),
235235
(
236236
["--region", "us-west-2", "--", "--collect-only"],
237237
["--collect-only"],
238-
[DEFAULT_FUNCTION, DEFAULT_ENDPOINT, "us-west-2", "30"],
238+
[DEFAULT_FUNCTION, DEFAULT_ENDPOINT, "us-west-2", "240"],
239239
),
240240
],
241241
)

0 commit comments

Comments
 (0)