Skip to content

integ tests should add retry loops for verifying async actions #33

@ghost

Description

Some tests in these sample apps check for async action's effect. For example, in ts-events we call a method that kicks off an async process that sets a persisted map. Our test then calls a second method that checks the value of the map. This check should be in a retry loop, since there's no guarantee that the async process will be completed by the time the check happens.

Today, the integ test runner action in klothoplatform/klotho retries the whole test suite if it fails. We need this because of our Lambda cold-starts, which cause pretty much anything that's not fargate to fail the first time. As it happens, the "put" path always writes the same value, so this suite-wide retry works as the test-scoped retry: there's a good chance that the second run of the suite will work, not because the second "put" has completed yet, but because the second "get" sees the result of the first "put".

At some point, we'll fix the cold start issues, and then be able to remove the suite-wide retry. When that happens, any async action's verification may start failing. We should add retry for that verification, to get ahead of the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions