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

Faucet Polling in E2E Tests #363

Merged
merged 3 commits into from
Sep 12, 2024
Merged

Faucet Polling in E2E Tests #363

merged 3 commits into from
Sep 12, 2024

Conversation

usmanmani1122
Copy link
Contributor

@usmanmani1122 usmanmani1122 commented Aug 29, 2024

Description

Updated test to poll for transaction completion

@usmanmani1122 usmanmani1122 self-assigned this Aug 29, 2024
Copy link

cloudflare-workers-and-pages bot commented Aug 29, 2024

Deploying agoric-dapp-inter-emerynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 256d924
Status: ✅  Deploy successful!
Preview URL: https://1a712796.agoric-dapp-inter-emerynet.pages.dev
Branch Preview URL: https://usman-faucet-polling.agoric-dapp-inter-emerynet.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented Aug 29, 2024

Deploying dapp-inter-test with  Cloudflare Pages  Cloudflare Pages

Latest commit: 256d924
Status: ✅  Deploy successful!
Preview URL: https://4e027f3d.dapp-inter-test.pages.dev
Branch Preview URL: https://usman-faucet-polling.dapp-inter-test.pages.dev

View logs

Copy link

github-actions bot commented Aug 29, 2024

Network:
Commit: 4de72f7
Ref: refs/heads/main
IPFS v1 hash: bafybeifw2fsj7v6jhbyfhb5cubt3d6md6vb6z6vwhh4mkkzgqet42eexle
CF - DWeb - 4EVERLAND

@usmanmani1122 usmanmani1122 changed the title Faucet Polling Faucet Polling in E2E Tests Sep 11, 2024
@usmanmani1122 usmanmani1122 marked this pull request as ready for review September 11, 2024 09:44
@usmanmani1122 usmanmani1122 added the emerynet To trigger Liquidation E2E tests using emerynet label Sep 11, 2024
if (transactionStatus === TRANSACTION_STATUS.NOT_FOUND)
// eslint-disable-next-line cypress/no-unnecessary-waiting
return cy.wait(2000).then(() => getStatus(txHash));
else return cy.wrap(transactionStatus);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use a maximum number of retires or some timeout to avoid an infinite loop? Is it possible that return cy.wait(2000).then(() => getStatus(txHash)); continues indefinitely?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cypress commands have a default timeout of 4 seconds so unless we have changed it, this shouldn't happen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Command timeout is 6 minutes for testnets and 2 minutes with local chain. Would that be fine? I think we should have 4 or 5 retries. That would be enough to make the call invalid, I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can confidentaly say that N number of retries should be enough to include a transaction in a block. I would say let's keep trying until the Cypress command timeout exceeds instead to get maximum retires in. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okies. Let's see how tests perform with this change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just feel that waiting 6 min for transaction status with testnets seems like an overkill

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you have a valid point. But I would like to see how often do we timeout waiting for the transaction to complete. Maybe we will need to do something about that if it is frequent.

@usmanmani1122 usmanmani1122 merged commit 4de72f7 into main Sep 12, 2024
12 of 15 checks passed
@usmanmani1122 usmanmani1122 deleted the usman/faucet-polling branch September 12, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emerynet To trigger Liquidation E2E tests using emerynet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants