-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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!: launchNode.cleanup
not killing node in last test of test group
#2718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job on this, ran it locally and pgrep fuel-core
comes back clean 😄 (As opposed to master which will report a pid)
Left some comments
packages/account/src/test-utils/launchNode-singular-test.test.ts
Outdated
Show resolved
Hide resolved
fe648f9
to
dc647cb
Compare
dc647cb
to
e7abaee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!
Coverage Report:
Changed Files:
|
launchTestNode
isn't closed in tests #2712Summary
Launching a
fuel-core
node vialaunchNode
and killing it via thecleanup
function wouldn't kill the last node in a test group because the test runner would exit before the node was killed and the node wouldn't get killed. The other nodes would get killed because there was enough time for the killing to happen before the last test finishes. Launching the nodes in a detached state and killing them viaprocess.kill(-child.pid)
did the trick.Besides this, multiple cleanup cases have been ensured to work as a result of the discussion in #2718 (comment).
Breaking Changes
The
killNode
andKillNodeParams
functionality has been internalized and the method and interface have been deleted so they're no longer exported. It's marked as a breaking change for pedantic reasons and there shouldn't really be any affected users given that they kill nodes viacleanup
which is unchanged, so no migration notes are necessary.Checklist
tests
to prove my changesdocs