Merge pull request #1697 from ethereum/test-script-kill

Kill the right eth process in tests
This commit is contained in:
Alex Beregszaszi 2017-02-14 14:11:05 +00:00 committed by GitHub
commit 6f1f0b392a

View File

@ -52,6 +52,7 @@ fi
# true and continue as normal, either processing further commands in a script # true and continue as normal, either processing further commands in a script
# or returning the cursor focus back to the user in a Linux terminal. # or returning the cursor focus back to the user in a Linux terminal.
$ETH_PATH --test -d /tmp/test & $ETH_PATH --test -d /tmp/test &
ETH_PID=$!
# Wait until the IPC endpoint is available. That won't be available instantly. # Wait until the IPC endpoint is available. That won't be available instantly.
# The node needs to get a little way into its startup sequence before the IPC # The node needs to get a little way into its startup sequence before the IPC
@ -66,7 +67,7 @@ echo "--> Running tests without optimizer..."
echo "--> Running tests WITH optimizer..." && \ echo "--> Running tests WITH optimizer..." && \
"$REPO_ROOT"/build/test/soltest --show-progress -- --optimize --ipcpath /tmp/test/geth.ipc "$REPO_ROOT"/build/test/soltest --show-progress -- --optimize --ipcpath /tmp/test/geth.ipc
ERROR_CODE=$? ERROR_CODE=$?
pkill eth || true pkill "$ETH_PID" || true
sleep 4 sleep 4
pgrep eth && pkill -9 eth || true pgrep "$ETH_PID" && pkill -9 "$ETH_PID" || true
exit $ERROR_CODE exit $ERROR_CODE