Skip to content

Commit

Permalink
fix: verification of all test nodes being killed
Browse files Browse the repository at this point in the history
  • Loading branch information
nedsalk committed Jul 15, 2024
1 parent 2ded63e commit 60a64bf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .changeset/neat-bikes-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

fix: verification of all test nodes being killed
22 changes: 0 additions & 22 deletions packages/account/src/test-utils/launchNode-singular-test.test.ts

This file was deleted.

15 changes: 11 additions & 4 deletions packages/fuel-gauge/src/transaction-response.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import {
WalletUnlocked,
ScriptTransactionRequest,
} from 'fuels';
import { generateTestWallet, launchNode, expectToThrowFuelError } from 'fuels/test-utils';
import {
generateTestWallet,
launchNode,
expectToThrowFuelError,
launchTestNode,
} from 'fuels/test-utils';
import type { MockInstance } from 'vitest';

async function verifyKeepAliveMessageWasSent(subscriptionStream: ReadableStream<Uint8Array>) {
Expand Down Expand Up @@ -113,10 +118,12 @@ describe('TransactionResponse', () => {
});

it('should ensure getTransactionSummary fetchs a transaction and assembles transaction summary', async () => {
const { ip, port } = await launchNode({
args: ['--poa-instant', 'false', '--poa-interval-period', '1s'],
using launched = await launchTestNode({
nodeOptions: {
args: ['--poa-instant', 'false', '--poa-interval-period', '1s'],
},
});
const nodeProvider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
const { provider: nodeProvider } = launched;

const destination = Wallet.generate({
provider: nodeProvider,
Expand Down
13 changes: 12 additions & 1 deletion scripts/tests-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@ fi

echo "Killing Fuel-Core node."

pkill fuel-core
# the fuel-core node used for some tests
# this should be removed once launchTestNode is used everywhere
kill "$(lsof -t -i :4000)"

# sleep for a second to give fuel-core nodes time to gracefully exit
sleep 1

if [[ -n "$(pgrep fuel-core)" ]]; then
echo "There are fuel-core processes left hanging."
echo "The problem is likely in how launchNode.cleanup works."
TEST_RESULT=1
fi

pnpm node:clean

Expand Down

0 comments on commit 60a64bf

Please sign in to comment.