Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reduce flakiness by favoring port 0 over portfinder dependency #3219

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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