Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f1f0b3

Browse files
authored
Merge pull request argotorg#1697 from ethereum/test-script-kill
Kill the right eth process in tests
2 parents 91d5515 + eeaa2ba commit 6f1f0b3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/tests.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ fi
5252
# true and continue as normal, either processing further commands in a script
5353
# or returning the cursor focus back to the user in a Linux terminal.
5454
$ETH_PATH --test -d /tmp/test &
55+
ETH_PID=$!
5556

5657
# Wait until the IPC endpoint is available. That won't be available instantly.
5758
# The node needs to get a little way into its startup sequence before the IPC
@@ -66,7 +67,7 @@ echo "--> Running tests without optimizer..."
6667
echo "--> Running tests WITH optimizer..." && \
6768
"$REPO_ROOT"/build/test/soltest --show-progress -- --optimize --ipcpath /tmp/test/geth.ipc
6869
ERROR_CODE=$?
69-
pkill eth || true
70+
pkill "$ETH_PID" || true
7071
sleep 4
71-
pgrep eth && pkill -9 eth || true
72-
exit $ERROR_CODE
72+
pgrep "$ETH_PID" && pkill -9 "$ETH_PID" || true
73+
exit $ERROR_CODE

0 commit comments

Comments
 (0)