Skip to content

Commit

Permalink
fix: reduce flakiness by favoring port 0 over portfinder dependen…
Browse files Browse the repository at this point in the history
…cy (#3219)

* chore: remove `portfinder` in favor of port `0`

* chore: changeset

* chore: changeset msg
  • Loading branch information
nedsalk authored Sep 27, 2024
1 parent 465bd5c commit f02fa88
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 114 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-starfishes-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/account": patch
---

fix: reduce flakiness by favoring port `0` over `portfinder` dependency
1 change: 0 additions & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"graphql": "^16.9.0",
"graphql-request": "5.0.0",
"graphql-tag": "^2.12.6",
"portfinder": "^1.0.32",
"ramda": "^0.30.1"
},
"devDependencies": {
Expand Down
10 changes: 1 addition & 9 deletions packages/account/src/test-utils/launchNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { defaultConsensusKey, hexlify, defaultSnapshotConfigs } from '@fuel-ts/u
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'fs';
import os from 'os';
import path from 'path';
import { getPortPromise } from 'portfinder';

import { Signer } from '../signer';

Expand Down Expand Up @@ -148,14 +147,7 @@ export const launchNode = async ({

const ipToUse = ip || '0.0.0.0';

const portToUse =
port ||
(
await getPortPromise({
port: 4000, // tries 4000 first, then 4001, then 4002, etc.
stopPort: 5000, // don't try ports above 5000
})
).toString();
const portToUse = port || '0';

let snapshotDirToUse: string;

Expand Down
Loading

0 comments on commit f02fa88

Please sign in to comment.