Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hot-fix] waiting server startup #308

Merged
merged 1 commit into from
Sep 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ src.test-coverage-vagrant:
src.test-bats:
sed -i.bak "s/localhost:9090/$$(minikube ip):30003/g; s/localhost:27017/$$(minikube ip):31717/g" config/testing.json
./build/src/cmd/vortex/vortex -config config/testing.json -port 7890 &
@echo "Waiting for server startup"
sleep 1
@cd tests;\
./test.sh

Expand Down
11 changes: 11 additions & 0 deletions tests/00-environement/00-env.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@
showmount -e | grep /nfsshare ; echo $?
[ $? = 0 ]
}

@test "Waiting vortex server startup" {
NEXT_WAIT_COUNT=0
WAIT_LIMIT=5
until http -hd 127.0.0.1:7890/v1/version 2>&1 | grep HTTP/ || [ $NEXT_WAIT_COUNT -eq $WAIT_LIMIT ]; do
echo "Waiting server startup"
sleep 0.4
NEXT_WAIT_COUNT=$((NEXT_WAIT_COUNT+ 1))
done
[ $NEXT_WAIT_COUNT != $WAIT_LIMIT ]
}