From 869245bef4079819c1dda72fc761c4e7aed0bb6a Mon Sep 17 00:00:00 2001 From: city_li Date: Tue, 15 Aug 2023 10:17:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cluster=E8=B0=83=E6=95=B4=E6=88=90?= =?UTF-8?q?=E5=8D=95=E8=8A=82=E7=82=B9=E9=9B=86=E7=BE=A4=20(#965)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: liwc1 Co-authored-by: 大可 --- .github/workflows/unit-test.yml | 2 +- pkg/client/redis/cluster_test.go | 2 +- test/data/cluster/conf/nodes.conf | 3 --- test/docker-compose.yaml | 8 ++------ 4 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 test/data/cluster/conf/nodes.conf diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 08587bf7be..b25489d102 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -32,7 +32,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.merge_commit_sha }} + ref: ${{ github.event.pull_request.head.sha }} - name: docker-compose run: docker-compose -f test/docker-compose.yaml up -d diff --git a/pkg/client/redis/cluster_test.go b/pkg/client/redis/cluster_test.go index ed11eee616..4b179a7ae3 100644 --- a/pkg/client/redis/cluster_test.go +++ b/pkg/client/redis/cluster_test.go @@ -28,7 +28,7 @@ func Test_Cluster(t *testing.T) { }) t.Run("normal start", func(t *testing.T) { - config.Addr = []string{"127.0.0.1:7000", "127.0.0.1:7001", "127.0.0.1:7002"} + config.Addr = []string{"localhost:7111"} config.name = "test" client, err := config.BuildCluster() if err != nil { diff --git a/test/data/cluster/conf/nodes.conf b/test/data/cluster/conf/nodes.conf deleted file mode 100644 index c3c3b72ffc..0000000000 --- a/test/data/cluster/conf/nodes.conf +++ /dev/null @@ -1,3 +0,0 @@ -7c7a2c8f6a55c4211e3d5e1d8e8af80a9d7c7a2c 127.0.0.1:7000@master -b0b24521fbf6c63d1e3d5e1d8e8af80a9d7c7a2c 127.0.0.1:7001@slave -0e0b8d6f6a55c4211e3d5e1d8e8af80a9d7c7a2c 127.0.0.1:7002@slave diff --git a/test/docker-compose.yaml b/test/docker-compose.yaml index d4a5494795..3e9f95ef49 100644 --- a/test/docker-compose.yaml +++ b/test/docker-compose.yaml @@ -12,12 +12,8 @@ services: image: redis:6.2-alpine restart: always ports: - - 7000:7000 - - 7001:7001 - - 7002:7002 - volumes: - - ./data/cluster/conf/nodes.conf:/data/cluster/conf/nodes.conf - command: redis-server --cluster-enabled yes --cluster-config-file /data/cluster/conf/nodes.conf --cluster-node-timeout 5000 --appendonly yes + - 7111:6380 + command: redis-server --port=6380 --cluster-enabled yes --cluster-node-timeout 5000 --appendonly yes db: image: mysql:5.7 # volumes: