diff --git a/src/function-run/nodejs/test/test.sh b/src/function-run/nodejs/test/test.sh index 8ab05116..e8ab274b 100755 --- a/src/function-run/nodejs/test/test.sh +++ b/src/function-run/nodejs/test/test.sh @@ -9,6 +9,11 @@ DIR=$(dirname $0) echo "-- Starting server" node $DIR/../server.js --codepath $DIR/test.js --port 8888 & +function cleanup() { + echo "-- Cleanup" + kill %1 +} +trap cleanup EXIT sleep 2 echo "-- Specializing" @@ -16,7 +21,3 @@ curl -f -X POST http://localhost:8888/specialize echo "-- Running user function" curl -f http://localhost:8888 ; echo - -echo "-- Cleanup" -kill %1 -