From a190e517fdf97d2f6aeed7ffa889763f72de3660 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Mon, 5 Aug 2024 09:57:11 +0530 Subject: [PATCH] Fix authority expiry timeout --- src/nameservice-expiry.test.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/nameservice-expiry.test.ts b/src/nameservice-expiry.test.ts index 184c13a..262d327 100644 --- a/src/nameservice-expiry.test.ts +++ b/src/nameservice-expiry.test.ts @@ -60,10 +60,11 @@ const nameserviceExpiryTests = () => { }); test('Wait for expiry duration', (done) => { - setTimeout(done, 60 * 1000); + // Wait expirty time + time for a block to be executed + const expiryTime = 60 * 1000; + const waitTime = expiryTime + (3 * 1000); - // Wait some more time for block to be executed - setTimeout(done, 3 * 1000); + setTimeout(done, waitTime); }); test('Check record expiry time', async () => { @@ -87,10 +88,11 @@ const nameserviceExpiryTests = () => { }); test('Wait for expiry duration', (done) => { - setTimeout(done, 60 * 1000); + // Wait expirty time + time for a block to be executed + const expiryTime = 60 * 1000; + const waitTime = expiryTime + (3 * 1000); - // Wait some more time for block to be executed - setTimeout(done, 3 * 1000); + setTimeout(done, waitTime); }); test('Check record deleted without bond balance', async () => {