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(multichain-testing): stir for no AVA timeout in long awaits #10234

Closed
wants to merge 1 commit into from

Conversation

michaelfig
Copy link
Member

@michaelfig michaelfig commented Oct 7, 2024

refs: #9934

Description

Reviewing the fact that AVA's "default timeout is 10 seconds", if no assertions are made during that timeout, AVA fails the test. The multichain-testing tests encounter this timeout when performing long synchronous calls (such as execFileSync) or awaits (notably during sleeps or during waiting for retry conditions that may take a long time).

Rather than attempting to solve this flake by trial-and-error moving AVA's timeout setting until the tests pass, this PR replaces execFileSync with execFileAsync, and allows the long "safe" awaits (execFileAsync, sleep, delay, retryUntilCondition, etc.) to "stir". That is, the test itself can specify a callback that will be invoked periodically when in a long safe await (that is, it already uses its own timeout/retry system). In those cases, the AVA assertion timeout gets in the way. If the stir callback contains a trivial AVA assertion, that will reset AVA's internal assertion clock to postpone failure by AVA timeout.

Security Considerations

n/a

Scaling Considerations

n/a

Documentation Considerations

n/a

Testing Considerations

A simple test of stirring while sleeping past the AVA timeout shows that this feature works. If this also helps avoid #9934, we should see fewer reports of flaky multichain-e2e tests.

Upgrade Considerations

n/a

@michaelfig michaelfig added tooling repo-wide infrastructure force:integration Force integration tests to run on PR labels Oct 7, 2024
@michaelfig michaelfig self-assigned this Oct 7, 2024
@michaelfig michaelfig force-pushed the mfig-9934-timeout-flakes branch from f2d042c to 90c02f8 Compare October 7, 2024 21:59
Copy link

cloudflare-workers-and-pages bot commented Oct 7, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: e4b5522
Status:🚫  Build failed.

View logs

@michaelfig michaelfig force-pushed the mfig-9934-timeout-flakes branch 9 times, most recently from 8bb71eb to 00686bd Compare October 8, 2024 18:16
@michaelfig michaelfig force-pushed the mfig-9934-timeout-flakes branch from 00686bd to e4b5522 Compare October 8, 2024 19:06
@michaelfig michaelfig closed this Nov 12, 2024
@michaelfig michaelfig deleted the mfig-9934-timeout-flakes branch November 12, 2024 18:11
@michaelfig
Copy link
Member Author

Withdrawing. The approach was completely flawed. There is no way to programmatically extend the overall AVA timeout set in config or command line argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
force:integration Force integration tests to run on PR tooling repo-wide infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant