-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one minor comment.
fcdfeaf
to
b69b7a3
Compare
Does this fix the issue described in #54? It seems there might be multiple issues in this case then, since the issue originally described there is relevant to tests failing with different outputs compared to expectations, and not having to do with async |
I get an error when running:
|
Hmm. This worked for me yesterday but now also fails. |
I think it is also a race condition because the TX eventually fails in the block explorer: |
So it seems to me that the doing an
Relies on the estimate gas call to fail but we are setting If we change the code to await expect(recordsMerkleTree.testUpdateRecordsMerkleTree(elems, { gasLimit: 10000000 })).to.be.revertedWith(
"The tree is full."
); then the test also fails against geth with (not reverted). Removing Alternatively we could avoid using estimate gas and check for actual reversion of transactions. This sounds a bit more robust. |
Related issue And code in waffle: uses the error string from estimateGas if possible |
@philippecamacho @NimaVaziri could you try again to see if this fixed the issue for you as well? |
Retrying |
Just retried rinkeby and the tests all passed. Retrying goerli now. |
Retried tests against goerli too and they all passed as well. I'm still confused as to why this change fixed the original issue though but it looks like it has. |
👍
|
Interestingly running
|
I'm also getting this. Don't know why it's happening at this point though. |
- Await transactions in tests. This only seems to cause a problem against slower networks because our local chains mine the transactions quickly enough. - Run test_2user against rinkeby. Works most of the time, unfortunately not always. - Remove manual gas setting from hardhat configs for rinkeby and goerli because it breaks tests that rely on the call to reverted due to estimageGas failing.
9e47dcb
to
c8eac5f
Compare
@@ -52,13 +52,11 @@ const config: HardhatUserConfig = { | |||
rinkeby: { | |||
url: process.env.RINKEBY_URL, | |||
gasPrice: 2_000_000_000, | |||
gas: 25_000_000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the gas
setting for the hardhat
config above not needed as well?
There was a problem hiding this comment.
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 need it but removing it did not fix the issue with --network hardhat
for me.
And related to this
if the plan is to integrate testnet-based testing into CI, is there an issue for making these tests run faster? |
There is but no ticket about speeding up tests. I'm thinking we can just run a few integration tests with a timer trigger once a day or whatever. Then it's fine if it takes a while to run. I imagine running transactions in parallel would require quite some extra engineering with the current state of the rust test code. |
@NimaVaziri Thanks for the review and testing. |
This fixes the test Records Merkle Tree tests shows that inserting too many leaves triggers an error Similarly to what we found in #271 The remaining failures in `hardhat test --network arbitrum` are caused by checking exact gas costs which differ on arbitrum and concern the following tests. Records Merkle Tree Benchmarks The Records Merkle root is updated with the frontier. 1) shows how much gas is spent by updateRecordsMerkleTree Rescue benchmarks Gas spent for computing the Rescue function 2) checks gas usage of TestRescue.hash 3) checks gas usage of TestRescueNonOptimized.hash Part of #25.
This fixes the test Records Merkle Tree tests shows that inserting too many leaves triggers an error Similarly to what we found in #271 The remaining failures in `hardhat test --network arbitrum` are caused by checking exact gas costs which differ on arbitrum and concern the following tests. Records Merkle Tree Benchmarks The Records Merkle root is updated with the frontier. 1) shows how much gas is spent by updateRecordsMerkleTree Rescue benchmarks Gas spent for computing the Rescue function 2) checks gas usage of TestRescue.hash 3) checks gas usage of TestRescueNonOptimized.hash Part of #25.
test_2user_and_submit against
rinkebyTo test put
RINKEBY_MNEMONIC
andRINKEBY_URL
in.env
(see readme for instructions). Then runThe tests are quite slow.
Close #54