Skip to content

Commit

Permalink
Merge pull request grpc#5974 from murgatroid99/node_distribtest_fixes
Browse files Browse the repository at this point in the history
Make distribtest more robust, especially on Mac
  • Loading branch information
nicolasnoble committed Mar 28, 2016
2 parents 680e50a + bebf2df commit f30bdb8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/distrib/node/run_distrib_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

function finish() {
rv=$?
kill $STATIC_PID || true
curl "localhost:32767/drop/$STATIC_PORT" || true
exit $rv
}

trap finish EXIT

NODE_VERSION=$1
source ~/.nvm/nvm.sh

Expand All @@ -39,7 +48,9 @@ set -ex
npm install -g node-static

STATIC_SERVER=127.0.0.1
STATIC_PORT=$$
# If port_server is running, get port from that. Otherwise, assume we're in
# docker and use 8080
STATIC_PORT=$(curl 'localhost:32767/get' || echo '8080')

# Serves the input_artifacts directory statically at localhost:
static "$EXTERNAL_GIT_ROOT/input_artifacts" -a $STATIC_SERVER -p $STATIC_PORT &
Expand All @@ -49,6 +60,4 @@ STATIC_URL="http://$STATIC_SERVER:$STATIC_PORT/"

npm install --unsafe-perm $STATIC_URL/grpc.tgz --grpc_node_binary_host_mirror=$STATIC_URL

kill -9 $STATIC_PID

./distrib_test.js

0 comments on commit f30bdb8

Please sign in to comment.