Skip to content

Commit

Permalink
Try waiting for cassandra to actually start up and start listening
Browse files Browse the repository at this point in the history
  • Loading branch information
Pchelolo committed Jul 7, 2017
1 parent ebabcb9 commit 823dd5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -23,7 +23,7 @@ before_install:
- wget https://archive.apache.org/dist/cassandra/${CASSANDRA_VERSION}/apache-cassandra-${CASSANDRA_VERSION}-bin.tar.gz -P ../
- tar -xzf ../apache-cassandra-${CASSANDRA_VERSION}-bin.tar.gz -C ../
- export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
- mkdir -p ../apache-cassandra-${CASSANDRA_VERSION}/log
- mkdir -p ../apache-cassandra-${CASSANDRA_VERSION}/logs
- sh ../apache-cassandra-${CASSANDRA_VERSION}/bin/cassandra

script: sh test/utils/run_tests.sh coverage ${TEST_TARGET} && (npm run-script coveralls || exit 0)
7 changes: 7 additions & 0 deletions test/utils/run_tests.sh
Expand Up @@ -11,6 +11,13 @@ runTest ( ) {
rm -f test.db.sqlite3
else
echo "Running with Cassandra backend"
if [ `nc localhost 9042 < /dev/null; echo $?` != 0 ]; then
echo "Waiting for Cassandra to start..."
while [ `nc -z localhost 9042; echo $?` != 0 ]; do
sleep 1
done
echo "Cassandra is ready."
fi
export RB_TEST_BACKEND=cassandra
sh ./test/utils/cleandb.sh
fi
Expand Down

0 comments on commit 823dd5f

Please sign in to comment.