Skip to content

Commit

Permalink
fix: gas price estimation test flakiness (#2981)
Browse files Browse the repository at this point in the history
* fix: gas price estimation test flakiness

* wait a bit before resolving

* Adding TODO

---------

Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
  • Loading branch information
2 people authored and maschad committed Aug 21, 2024
1 parent de0aac1 commit 9fef131
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-numbers-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/account": patch
---

fix: gas price estimation test flakiness
24 changes: 15 additions & 9 deletions packages/account/src/test-utils/launchNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9fef131

Please sign in to comment.