From b16c5df0f2a3eb3e6814ad06eaa6082722cfe0dc Mon Sep 17 00:00:00 2001 From: xxhZs <1060434431@qq.com> Date: Fri, 7 Jun 2024 11:19:02 +0800 Subject: [PATCH] fix --- ci/scripts/e2e-cassandra-sink-test.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/ci/scripts/e2e-cassandra-sink-test.sh b/ci/scripts/e2e-cassandra-sink-test.sh index f04c336bc65b3..a37a9077f0211 100755 --- a/ci/scripts/e2e-cassandra-sink-test.sh +++ b/ci/scripts/e2e-cassandra-sink-test.sh @@ -38,13 +38,24 @@ sleep 1 echo "--- create cassandra table" curl https://downloads.apache.org/cassandra/4.0.13/apache-cassandra-4.0.13-bin.tar.gz --output apache-cassandra-4.0.13-bin.tar.gz tar xfvz apache-cassandra-4.0.13-bin.tar.gz +# remove bundled packages, and use installed packages, because Python 3.12 has removed asyncore, but I failed to install libev support for bundled Python driver. +rm apache-cassandra-4.0.13/lib/six-1.12.0-py2.py3-none-any.zip +rm apache-cassandra-4.0.13/lib/cassandra-driver-internal-only-3.25.0.zip +apt-get install -y libev4 libev-dev +pip3 install --break-system-packages cassandra-driver -cd apache-cassandra-4.0.13/bin -./cqlsh cassandra-server -e "CREATE KEYSPACE demo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};use demo; +cd apache-cassandra-4.0.13 + + +bin/cassandra -R & +CASSANDRA_PID=$! +sleep 10 + +./bin/cqlsh -e "CREATE KEYSPACE demo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};use demo; CREATE table demo_bhv_table(v1 int primary key,v2 smallint,v3 bigint,v4 float,v5 double,v6 text,v7 date,v8 timestamp,v9 boolean);" echo "--- testing sinks" -cd ../../ +cd ../ sqllogictest -p 4566 -d dev './e2e_test/sink/cassandra_sink.slt' sleep 1 cd apache-cassandra-4.0.13/bin @@ -61,5 +72,10 @@ else fi echo "--- Kill cluster" + +trap 'kill $CASSANDRA_PID' SIGINT +wait $CASSANDRA_PID +echo "cassandra finished" + cd ../../ risedev ci-kill \ No newline at end of file