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

Fix test failing intermittently #606

Merged
merged 10 commits into from
Feb 28, 2025
Merged

Conversation

brunoguerios
Copy link
Member

  • Fix Add Liquidity Boosted Integration test that was intermittently failing on CI

Also:
Closes #565

@brunoguerios
Copy link
Member Author

Main change: adapt anvil fork to mine blocks every 1 second, instead of default behavior of instant auto-mine after every transaction.

Worth noting that this caused issues with how we read balances to check for success. Apparently getBalance reads are applied to the last block mined, so we need to wait for confirmation of the token balance setup (i.e. stataUSDT minting on this specific test) in order to properly read balances and assert results.

Also, apparently snapshot doesn't work well with these time based blocks, so these tests are "incremental" in the sense that they run one after the other in the same local fork.

@MattPereira
Copy link
Member

I think this is just problem with my machine that I will investigate, but wanted to report just in case

For some reason takes more than twice as long for me to run locally vs the GHA

image

Copy link
Member

@MattPereira MattPereira left a comment

Choose a reason for hiding this comment

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

@brunoguerios Fantastic job hunting down the solution for this one! 🎉

Will be so nice to not have to re-run the tests for future PRs / releases 😌

Copy link
Contributor

@mkflow27 mkflow27 left a comment

Choose a reason for hiding this comment

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

Great changes Bruno.

@mkflow27
Copy link
Contributor

I think this is just problem with my machine that I will investigate, but wanted to report just in case

For some reason takes more than twice as long for me to run locally vs the GHA

image

Same for me.
Screenshot 2025-02-27 at 10 09 55
This error has happened a few times before on my machine as well but for different files.

@@ -51,7 +51,7 @@ const sDAI = TOKENS[chainId].sDAI;
const BRLA = TOKENS[chainId].BRLA;

// skipping until we figure out why test is failing on CI
Copy link
Member

Choose a reason for hiding this comment

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

Remove this comment

@brunoguerios
Copy link
Member Author

I'm tracking down the source of the issue here. Apparently the issue lies in the fallBackRpc url, because the one I have set on .env is working as expected. I'll fix that over here.

@brunoguerios
Copy link
Member Author

Sharing what I found so you're aware:

attempting to fetch an env var as process.env[<<key>>] for a non existing key will sometimes return undefined and sometimes 'undefined' as string - we have to check both cases before deciding to use the fallBackRpc

@brunoguerios brunoguerios merged commit de8956d into main Feb 28, 2025
4 checks passed
@brunoguerios brunoguerios deleted the fix-test-failing-intermittently branch February 28, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix add liquidity proportional integration test failing on CI
4 participants