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: dotenv test is flaky #1340

Merged
merged 4 commits into from
May 29, 2024
Merged

Conversation

willemneal
Copy link
Member

fixes: #1335
This is currently blocking CI and failing on main. Given that clap handles ensuring that CLI args have higher priority than ENV vars, this test is more of a sanity check so it could also just be removed.

fixes: stellar#1335
This is currently blocking CI and failing on main. Given that clap handles ensuring that CLI args have higher priority than ENV vars, this test is more of a sanity check so it could also just be removed.
@willemneal willemneal requested a review from leighmcculloch May 28, 2024 21:26
@willemneal
Copy link
Member Author

@leighmcculloch This is definitely a bad code smell and deserves an investigation why sleeps fix the concurrency issue, but do you think it's fine to just let it pass for now since it's a blocker for other PRs?

@leighmcculloch leighmcculloch enabled auto-merge (squash) May 28, 2024 23:43
Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

Looks good, just going to strip out changes that seem unrelated.

.cargo/config.toml Outdated Show resolved Hide resolved
FULL_HELP_DOCS.md Outdated Show resolved Hide resolved
cmd/soroban-cli/example_contracts.list Outdated Show resolved Hide resolved
@leighmcculloch
Copy link
Member

leighmcculloch commented May 28, 2024

@leighmcculloch This is definitely a bad code smell and deserves an investigation why sleeps fix the concurrency issue, but do you think it's fine to just let it pass for now since it's a blocker for other PRs?

There's not much point removing this test because other tests have sleeps too. There's something up with the cost to do txns and the resources required which are racing and getting it wrong. Likely because we're reusing the same account over and over. In other projects where we use a live network we create new accounts on every test, so the tests can run entirely isolate each other. That's the fix we need I think.

@leighmcculloch leighmcculloch merged commit bf33127 into stellar:main May 29, 2024
18 of 19 checks passed
@willemneal
Copy link
Member Author

Each test should be a different account. It's just in this case they are all trying to deploy the same contract... But so do other tests so I'm really at a loss for the cause.

@willemneal willemneal deleted the fix/flaky_test branch May 29, 2024 02:59
@leighmcculloch
Copy link
Member

I was too specific, the creation of a resource that has a different resource usage on first creation vs update. Accounts are a common culprit, but the WASM install / contract deploy would be similar.

@leighmcculloch
Copy link
Member

One way to see if that would fix it and allow us to get rid of the sleeps, would be to make the .wasm files unique for each test. Which can be done by writing some random data into a custom section of the wasm:

$ echo $RANDOM | wasm-cs file.wasm write makeunique

@willemneal
Copy link
Member Author

Great idea! Though I'm wondering if perhaps we can instead change the install step to first check if the ledger entry exists. Though this too could run into a race condition. So I will look into using wasm-cs to remove these and in general make all tests more isolated.

@leighmcculloch
Copy link
Member

There are some conditions when install should be allowed even though it is already installed. V21 added some situations where if you reinstall your contract will be updated with new data calculated at install time that make it more optimal (CAP-54, CAP-56).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Test
2 participants