cloudformation-cli icon indicating copy to clipboard operation
cloudformation-cli copied to clipboard

Do `cfn test` contract tests handle InProgress?

Open msummers-nr opened this issue 3 years ago • 2 comments

Do cfn test contract tests process InProgress responses?

I'm running the contract tests on my custom resource and every test fails with

    assert status == OperationStatus.SUCCESS, "status should be SUCCESS"
E   AssertionError: status should be SUCCESS

The lambda's log for create_create shows

START RequestId: bd3ee212-09d3-4ff1-bc1e-b0e1175bc127 Version: $LATEST
2022/07/14 14:31:22 Handler starting
2022/07/14 14:31:22 Handler received the CREATE action
2022/07/14 14:31:22 Received event: IN_PROGRESS
Message: Create in progress
END RequestId: bd3ee212-09d3-4ff1-bc1e-b0e1175bc127
REPORT RequestId: bd3ee212-09d3-4ff1-bc1e-b0e1175bc127	Init Duration: 0.05 ms	Duration: 236.84 ms	Billed Duration: 237 ms	Memory Size: 256 MB	Max Memory Used: 256 MB	
2022-07-14 09:31:22 127.0.0.1 - - [14/Jul/2022 09:31:22] "POST /2015-03-31/functions/TypeFunction/invocations HTTP/1.1" 200 -
Invoking handler (go1.x)
Reuse the created warm container for Lambda function 'TypeFunction'
Lambda function 'TypeFunction' is already running
START RequestId: 929cbe74-aade-4c40-b286-d2139d07c2db Version: $LATEST
2022/07/14 14:31:23 Handler received the DELETE action
2022/07/14 14:31:23 Delete: guid: map[]
2022/07/14 14:31:23 Received event: FAILED

Create immediately followed by Delete rather than waiting for Success.

msummers-nr avatar Jul 14 '22 14:07 msummers-nr

there is a while loop, which runs until handler reaches terminal state - code ref

ammokhov avatar Jul 14 '22 20:07 ammokhov

Thanks @ammokhov , I missed that looking through the code- I'll put some print statements there to see what's going on.

msummers-nr avatar Jul 15 '22 11:07 msummers-nr

Closing for now but please re-open if you run into this issue again!

mmaeng avatar Oct 17 '22 21:10 mmaeng