-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Response errors; unexpected block execution error OutputAlreadyExists When Running Multiple Tests #89
Comments
Does this happen when running tests sequentially? My first guess is that if you run tests more than once, it'll try to deploy the same contracts again. Since they already exist in the state, you'll get that error. If can be fixed by clearning |
It still seems to be happening even if I comment out all the other tests, rm |
Guessing this is probably an SDK issue then. cc @digorithm to triage. |
That's odd. I always get this error when deploying a contract already deployed, as expected. And then removing the fuel dir does it for me. Weird that removing the dir isn't resolving the issue in your case, I'll do some triaging today! |
Update: managed to replicate, have a few ideas of what might be causing it. Will post an update soon! |
Alright, this was a tricky one to debug, and it highlights some shortcomings in the The issue begins at this fundamental truth: every call we make at the SDK/client level generates a transaction. That means we don't have a concept of read-only That said... Sushi Sway is doing a couple of things:
The issue here is that (2) and (4), the two checks, look like this: let balance_of_check0 = mycontract_mod::BalanceOfInput {
address: [10; 32],
asset_id: [0; 32],
};
let initial_bal = contract_instance
.balance_of(balance_of_check0) // <--- first call to balance_of
.call()
.await
.unwrap(); and let balance_of_check1 = mycontract_mod::BalanceOfInput {
address: [10; 32],
asset_id: [0; 32],
};
let final_bal = contract_instance
.balance_of(balance_of_check1) // <--- second call to balance_of
.call()
.await
.unwrap(); Notice that, because The shortcoming on our end is that a method that's supposed to be read-only is actually generating a transaction when it shouldn't. But we don't have an API for read-only yet. Short-term very weird workaround: make The actual solution, as suggested in a conversation with @Voxelot, to split the generated methods (by the cc @adlerjohn once we agree on the solution, the semantics, and the naming of |
Yeah, makes sense to separate call and send in the same way as Ethereum, and using dry run. Good work debugging! |
Should this issue be transferred to fuels-rs @digorithm ? |
Note that we also need a solution for non-view-only calls that happen to modify state rather than being inherently view-only. This could be accomplished by inserting a random coin input. Or better, a change output to a random address! |
Tracking this here #90 |
So was finally getting around to debugging my Sushi Sway Repo my withdraw test was failing with the following error
It seems there seems to be some concurrency failure when running multiple tests at once. If this an error in my code though let me know and I can close the issue
The text was updated successfully, but these errors were encountered: