You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following server release test fails intermittently causing flakiness in our test suite.
$
[...] 0 passing (1m) 1 failing 1) RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests eth_getBalance @release should execute "eth_getBalance" with block number in the last 15 minutes for account that has performed contract deploys/calls: AssertionError: expected '0x2b4f651f00ed82400' to equal '0x2a6f0f4064b89c800' + expected - actual -0x2b4f651f00ed82400 +0x2a6f0f4064b89c800 at Context.<anonymous> (packages/server/tests/acceptance/rpc_batch2.spec.ts:552:22) at Generator.next (<anonymous>) at fulfilled (packages/server/tests/acceptance/rpc_batch2.spec.ts:6:58) at processTicksAndRejections (node:internal/process/task_queues:105:5)[...]
it('@release should execute "eth_getBalance" with block number in the last 15 minutes for account that has performed contract deploys/calls',asyncfunction(){
The issue seems to be a race condition when accounts0StartBalance is set at blockNumberAtStartOfTests. PR #3495 refactors these tests. However, it seems it also changed its semantics. See
in particular note how before said PR the line pollForValidTransactionReceipt(createChildTx.hash) was before setting the value for accounts0StartBalance. Moreover, the line [childTx, blockNumber, balance] = await Promise.all[...] can be causing additional issues because if childTx was included in blockNumber then the reported balance would be incorrect.
Another thing to take into account could be the cache on eth_blockNumber. If there is another call to eth_blockNumber (on a public network this can easily happen) while the test is being setup, then blockNumberAtStartOfTests could refer to a cached block number. This could also be the source of the issue described above.
The following server release test fails intermittently causing flakiness in our test suite.
Note
This happens against both previewnet and testnet
For reference, here's the failing test
hiero-json-rpc-relay/packages/server/tests/acceptance/rpc_batch2.spec.ts
Lines 540 to 548 in 69bf510
The issue seems to be a race condition when
accounts0StartBalance
is set atblockNumberAtStartOfTests
. PR #3495 refactors these tests. However, it seems it also changed its semantics. Seehttps://github.com/hiero-ledger/hiero-json-rpc-relay/pull/3495/files#diff-e91ffd80132cb7a1d8cfed9a53ebc797b745e3113c4cd7004b02a0679566d2d4R138-R148
in particular note how before said PR the line
pollForValidTransactionReceipt(createChildTx.hash)
was before setting the value foraccounts0StartBalance
. Moreover, the line[childTx, blockNumber, balance] = await Promise.all[...]
can be causing additional issues because ifchildTx
was included inblockNumber
then the reportedbalance
would be incorrect.Another thing to take into account could be the cache on
eth_blockNumber
. If there is another call toeth_blockNumber
(on a public network this can easily happen) while the test is being setup, thenblockNumberAtStartOfTests
could refer to a cached block number. This could also be the source of the issue described above.hiero-json-rpc-relay/packages/relay/src/lib/services/ethService/ethCommonService/index.ts
Lines 283 to 299 in 69bf510
The text was updated successfully, but these errors were encountered: