diff --git a/package-lock.json b/package-lock.json index 761b98c12..013d739ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,6 +55,7 @@ "@types/tmp": "^0.2.6", "@types/uuid": "^10.0.0", "@types/ws": "^8.5.10", + "@types/wtfnode": "^0.7.3", "@typescript-eslint/eslint-plugin": "^7.1.0", "@typescript-eslint/parser": "^7.1.0", "buffer": "^6.0.3", @@ -84,7 +85,8 @@ "typedoc-plugin-markdown": "^3.17.1", "typedoc-plugin-merge-modules": "^5.1.0", "typedoc-theme-hierarchy": "4.1.2", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "wtfnode": "^0.9.3" }, "engines": { "node": ">=18.0.0" @@ -3939,6 +3941,12 @@ "@types/node": "*" } }, + "node_modules/@types/wtfnode": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@types/wtfnode/-/wtfnode-0.7.3.tgz", + "integrity": "sha512-UMkHpx+o2xRWLJ7PmT3bBzvIA9/0oFw80oPtY/xO4jfdq+Gznn4wP7K9B/JjMxyxy+wF+5oRPIykxeBbEDjwRg==", + "dev": true + }, "node_modules/@types/yargs": { "version": "17.0.32", "dev": true, @@ -18973,6 +18981,15 @@ } } }, + "node_modules/wtfnode": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/wtfnode/-/wtfnode-0.9.3.tgz", + "integrity": "sha512-MXjgxJovNVYUkD85JBZTKT5S5ng/e56sNuRZlid7HcGTNrIODa5UPtqE3i0daj7fJ2SGj5Um2VmiphQVyVKK5A==", + "dev": true, + "bin": { + "wtfnode": "proxy.js" + } + }, "node_modules/xml": { "version": "1.0.1", "dev": true, diff --git a/package.json b/package.json index cdaaf7888..544345c8b 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,9 @@ "typedoc-plugin-markdown": "^3.17.1", "typedoc-plugin-merge-modules": "^5.1.0", "typedoc-theme-hierarchy": "4.1.2", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "@types/wtfnode": "^0.7.3", + "wtfnode": "^0.9.3" }, "optionalDependencies": { "@rollup/rollup-darwin-x64": "^4", diff --git a/src/golem-network/golem-network.ts b/src/golem-network/golem-network.ts index acdb784db..076735c19 100644 --- a/src/golem-network/golem-network.ts +++ b/src/golem-network/golem-network.ts @@ -1,3 +1,4 @@ +import * as wtf from "wtfnode"; import { anyAbortSignal, createAbortSignalFromTimeout, defaultLogger, isNode, Logger, YagnaApi } from "../shared/utils"; import { Demand, @@ -362,6 +363,9 @@ export class GolemNetwork { * @return Resolves when all shutdown steps are completed */ async disconnect() { + setTimeout(() => { + wtf.dump(); + }, 33_333); if (this.disconnectPromise) { return this.disconnectPromise; } diff --git a/tests/examples/examples.test.ts b/tests/examples/examples.test.ts index de4758a4c..bd09c4d85 100644 --- a/tests/examples/examples.test.ts +++ b/tests/examples/examples.test.ts @@ -47,7 +47,7 @@ async function test(cmd: string, path: string, args: string[] = [], timeout = 36 console.log("Test finishing has already been triggered by another event"); return; } - console.log(`Subprocess with test ${file} exited with code ${code} by signal ${signal}`); + console.log(`Subprocess with test "${file}" exited with code ${code}, signal ${signal}`); isFinishing = true; spawnedExample.removeAllListeners(); spawnedExample.stdout.removeAllListeners();