Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test tools for async flow #9753

Open
mhofman opened this issue Jul 22, 2024 · 3 comments
Open

Test tools for async flow #9753

mhofman opened this issue Jul 22, 2024 · 3 comments
Assignees
Labels
asyncFlow related to membrane-based replay and upgrade of async functions enhancement New feature or request

Comments

@mhofman
Copy link
Member

mhofman commented Jul 22, 2024

What is the Problem Being Solved?

In order to gain confidence in the resumability of orchestrated flows, we need to actually upgrade contracts at different steps of an orchestrated flow.

Description of the Design

One way to do that might be to have a test jig into async flow to enable executing the guest function "step by step".

For retriable, it'd give a way to not fulfil the vow with the result of the retried function, or run the retried function multiple times before fulfilling.

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

@mhofman mhofman added enhancement New feature or request asyncFlow related to membrane-based replay and upgrade of async functions labels Jul 22, 2024
@turadg
Copy link
Member

turadg commented Jul 22, 2024

In discussion we realized this might detect false-positives because it will allow stopping at places the kernel won't. As an alternative, we can have bootstrapTests force bridge stalls through the message mocking. @michaelfig and I will pursue that in the context of #9303. I think we should leave this ticket open for some general utilities for async-flow.

@mhofman
Copy link
Member Author

mhofman commented Jul 25, 2024

Another use case that has recently arisen is the ability to more easily test values piercing the membrane: #9780

@mhofman
Copy link
Member Author

mhofman commented Oct 23, 2024

What we really want here is to detect any issue (with the contract or with the orchestration framework itself) when an upgrade could happen, aka when external messages come in from outside swingset. For that if a test is structured with a list of inputs from the network, we can simply inject and upgrade at that time. In a perfect world, we would tests both the upgrade and non-upgrade paths, and we would test upgrading any combination of running vats.

A different approach would be to mock the orchestration API so that a single contract using orchestration can be put through a similar simulated upgrade of either orchestration or of the contract vat. That however requires a somewhat faithful mock of the orchestration API.

We likely do not want to test a simulated upgrade at all await points of an async-flow.

Maybe integrate with @gibson042's test pattern for IBC step-by-step play.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asyncFlow related to membrane-based replay and upgrade of async functions enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants