Skip to content

Commit 2f9f39d

Browse files
committed
Improved cassandra checks
1 parent cb85a97 commit 2f9f39d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/go.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,28 @@ jobs:
111111
sudo apt-get update
112112
sudo apt-get install -y postgresql-client
113113
114-
# Install Cassandra client
115-
sudo apt-get install -y curl
114+
# Install Cassandra client and netcat
115+
sudo apt-get install -y curl netcat
116116
curl -fsSL https://www.apache.org/dist/cassandra/KEYS | sudo gpg --dearmor -o /usr/share/keyrings/cassandra-archive-keyring.gpg
117117
echo "deb [signed-by=/usr/share/keyrings/cassandra-archive-keyring.gpg] https://apache.jfrog.io/artifactory/cassandra-deb/ 40x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
118118
sudo apt-get update
119119
sudo apt-get install -y cassandra-tools
120120
121121
- name: Create Cassandra keyspace
122122
run: |
123+
# First wait for the port to be open
124+
until nc -z localhost 9042; do
125+
echo "Waiting for Cassandra port to be ready..."
126+
sleep 5
127+
done
128+
129+
# Then wait for Cassandra to be fully initialized
123130
until cqlsh -u cassandra -p cassandra -e 'describe keyspaces' localhost 9042 > /dev/null 2>&1; do
124131
echo "Waiting for Cassandra to be ready..."
125132
sleep 5
126133
done
134+
135+
echo "Creating Cassandra keyspace..."
127136
cqlsh -u cassandra -p cassandra -e "CREATE KEYSPACE IF NOT EXISTS perfkit_db_ci WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};" localhost 9042
128137
129138
- name: Create vector extension

0 commit comments

Comments
 (0)