From 153da866f06a1530a5740a619215c326cbf79c1c Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Mon, 20 Jul 2020 15:00:15 +0300 Subject: [PATCH] fix: ipfsd-ctl should await for subprocess --- ...-fix-allow-either-cidv-0-1-in-refs-local-test.patch | 4 ++-- conformance/patches/await_subprocess.patch | 10 ++++++++++ conformance/setup.sh | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 conformance/patches/await_subprocess.patch diff --git a/conformance/patches/0001-fix-allow-either-cidv-0-1-in-refs-local-test.patch b/conformance/patches/0001-fix-allow-either-cidv-0-1-in-refs-local-test.patch index 3760bfba..28f54397 100644 --- a/conformance/patches/0001-fix-allow-either-cidv-0-1-in-refs-local-test.patch +++ b/conformance/patches/0001-fix-allow-either-cidv-0-1-in-refs-local-test.patch @@ -14,8 +14,8 @@ implementation to use either version internally. diff --git a/packages/interface-ipfs-core/src/refs-local.js b/packages/interface-ipfs-core/src/refs-local.js index d20851de..33a94c74 100644 ---- a/packages/interface-ipfs-core/src/refs-local.js -+++ b/packages/interface-ipfs-core/src/refs-local.js +--- a/interface-ipfs-core/src/refs-local.js ++++ b/interface-ipfs-core/src/refs-local.js @@ -7,6 +7,7 @@ const all = require('it-all') const importer = require('ipfs-unixfs-importer') const drain = require('it-drain') diff --git a/conformance/patches/await_subprocess.patch b/conformance/patches/await_subprocess.patch new file mode 100644 index 00000000..66daa969 --- /dev/null +++ b/conformance/patches/await_subprocess.patch @@ -0,0 +1,10 @@ +--- node_modules/ipfsd-ctl/src/ipfsd-daemon.js 2020-03-06 15:26:44.365192780 +0200 ++++ node_modules/ipfsd-ctl/src/ipfsd-daemon.js 2020-07-20 14:54:43.353680062 +0300 +@@ -260,6 +250,7 @@ + + try { + await this.api.stop() ++ await this.subprocess; + } catch (err) { + if (!killed) { + throw err // if was killed then ignore error diff --git a/conformance/setup.sh b/conformance/setup.sh index 57333749..a6ff712a 100755 --- a/conformance/setup.sh +++ b/conformance/setup.sh @@ -21,6 +21,6 @@ if [ -d "patches" ]; then # and node_modules are ignored. for p in patches/*; do echo "Applying $(basename "$p")..." >&2 - patch -d node_modules/interface-ipfs-core/ -p3 < "$p" + patch -d node_modules/ -p1 < "$p" done fi