From 9fef1310a7a8300ff01f3bbfaea00929486773ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nedim=20Salki=C4=87?= Date: Mon, 19 Aug 2024 22:20:29 +0200 Subject: [PATCH] fix: gas price estimation test flakiness (#2981) * fix: gas price estimation test flakiness * wait a bit before resolving * Adding TODO --------- Co-authored-by: Anderson Arboleya --- .changeset/new-numbers-talk.md | 5 ++++ packages/account/src/test-utils/launchNode.ts | 24 ++++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 .changeset/new-numbers-talk.md diff --git a/.changeset/new-numbers-talk.md b/.changeset/new-numbers-talk.md new file mode 100644 index 00000000000..d90a8566ca6 --- /dev/null +++ b/.changeset/new-numbers-talk.md @@ -0,0 +1,5 @@ +--- +"@fuel-ts/account": patch +--- + +fix: gas price estimation test flakiness diff --git a/packages/account/src/test-utils/launchNode.ts b/packages/account/src/test-utils/launchNode.ts index 0a335bf5631..95b9ebb19bf 100644 --- a/packages/account/src/test-utils/launchNode.ts +++ b/packages/account/src/test-utils/launchNode.ts @@ -265,15 +265,21 @@ export const launchNode = async ({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const [realIp, realPort] = rowWithUrl.split(' ').at(-1)!.trim().split(':'); // e.g. "2024-02-13T12:31:44.445844Z INFO new{name=fuel-core}: fuel_core::graphql_api::service: 216: Binding GraphQL provider to 127.0.0.1:35039" - // Resolve with the cleanup method. - resolve({ - cleanup, - ip: realIp, - port: realPort, - url: `http://${realIp}:${realPort}/v1/graphql`, - snapshotDir: snapshotDirToUse as string, - pid: child.pid as number, - }); + // TODO: Remove delay after fuel-core issue is fixed + // https://github.com/FuelLabs/fuel-core/issues/2107 + setTimeout( + () => + // Resolve with the cleanup method. + resolve({ + cleanup, + ip: realIp, + port: realPort, + url: `http://${realIp}:${realPort}/v1/graphql`, + snapshotDir: snapshotDirToUse as string, + pid: child.pid as number, + }), + 500 + ); } if (/error/i.test(text)) { // eslint-disable-next-line no-console