From bb9ec362bd18e07b9e631316113d9e95de9e1205 Mon Sep 17 00:00:00 2001 From: Mariusz Jasuwienas Date: Mon, 1 Dec 2025 14:56:26 +0100 Subject: [PATCH] test: stabilize tests by adjusting time waiting for mine and price tolerance (#4658) Signed-off-by: Mariusz Jasuwienas --- packages/server/tests/acceptance/hbarLimiter.spec.ts | 1 + packages/server/tests/acceptance/rpc_batch1.spec.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/server/tests/acceptance/hbarLimiter.spec.ts b/packages/server/tests/acceptance/hbarLimiter.spec.ts index 1450e29d2b..569aa0830d 100644 --- a/packages/server/tests/acceptance/hbarLimiter.spec.ts +++ b/packages/server/tests/acceptance/hbarLimiter.spec.ts @@ -330,6 +330,7 @@ describe('@hbarlimiter HBAR Limiter Acceptance Tests', function () { }); it('should deploy a large contract and decrease remaining HBAR in limiter when transaction data is large', async function () { + overrideEnvsInMochaDescribe({ TEST_TRANSACTION_RECORD_COST_TOLERANCE: 0.25 }); const initialRemainingHbars = Number(await metrics.get(testConstants.METRICS.REMAINING_HBAR_LIMIT)); expect(initialRemainingHbars).to.be.gt(0); diff --git a/packages/server/tests/acceptance/rpc_batch1.spec.ts b/packages/server/tests/acceptance/rpc_batch1.spec.ts index b3f18bc55c..86d3af8504 100644 --- a/packages/server/tests/acceptance/rpc_batch1.spec.ts +++ b/packages/server/tests/acceptance/rpc_batch1.spec.ts @@ -688,7 +688,7 @@ describe('@api-batch-1 RPC Server Acceptance Tests', function () { it('should not cache "latest" block in "eth_getBlockByNumber" ', async function () { const blockResult = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GET_BLOCK_BY_NUMBER, ['latest', false]); - await Utils.wait(1000); + await Utils.wait(2000); const blockResult2 = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GET_BLOCK_BY_NUMBER, ['latest', false]); expect(blockResult).to.not.deep.equal(blockResult2); @@ -696,7 +696,7 @@ describe('@api-batch-1 RPC Server Acceptance Tests', function () { it('should not cache "finalized" block in "eth_getBlockByNumber" ', async function () { const blockResult = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GET_BLOCK_BY_NUMBER, ['finalized', false]); - await Utils.wait(1000); + await Utils.wait(2000); const blockResult2 = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GET_BLOCK_BY_NUMBER, ['finalized', false]); expect(blockResult).to.not.deep.equal(blockResult2); @@ -704,7 +704,7 @@ describe('@api-batch-1 RPC Server Acceptance Tests', function () { it('should not cache "safe" block in "eth_getBlockByNumber" ', async function () { const blockResult = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GET_BLOCK_BY_NUMBER, ['safe', false]); - await Utils.wait(1000); + await Utils.wait(2000); const blockResult2 = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GET_BLOCK_BY_NUMBER, ['safe', false]); expect(blockResult).to.not.deep.equal(blockResult2); @@ -712,7 +712,7 @@ describe('@api-batch-1 RPC Server Acceptance Tests', function () { it('should not cache "pending" block in "eth_getBlockByNumber" ', async function () { const blockResult = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GET_BLOCK_BY_NUMBER, ['pending', false]); - await Utils.wait(1000); + await Utils.wait(2000); const blockResult2 = await relay.call(RelayCalls.ETH_ENDPOINTS.ETH_GET_BLOCK_BY_NUMBER, ['pending', false]); expect(blockResult).to.not.deep.equal(blockResult2);