Skip to content

Commit

Permalink
abort after 10 sec timeout if port cannot be determined
Browse files Browse the repository at this point in the history
  • Loading branch information
jberthold committed Jan 31, 2024
1 parent 7135092 commit 7addf8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion k-distribution/tests/smoke/krpc-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $(TESTS): %.rpc: %-request.json %-response.json kompile kompile-llvm
$(KOMPILED_DIR)/definition.kore --module IMP --server-port 0 \
--llvm-backend-library ./$(KOMPILED_LLVM_DIR)/interpreter.$(LIB_SUFFIX) & \
echo $$! > $*.server.pid)
bash -c "while ! lsof -a -p$$(cat $*.server.pid) -sTCP:LISTEN -iTCP; do echo .; sleep 1; done"
timeout 10 bash -c "while ! lsof -a -p$$(cat $*.server.pid) -sTCP:LISTEN -iTCP; do echo .; sleep 1; done"
lsof -a -p$$(cat $*.server.pid) -sTCP:LISTEN -iTCP | grep $$(cat $*.server.pid) | sed -e 's/.* TCP \*:\([0-9]*\).*$$/\1/' > $*.server.port

@echo "Server running as process $$(cat $*.server.pid) on port $$(cat $*.server.port)"
Expand Down

0 comments on commit 7addf8f

Please sign in to comment.