This is an automated email from the ASF dual-hosted git repository.
hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 2901e56c ci: execute long running go tests in parallel (#2763)
2901e56c is described below
commit 2901e56c29c639bf9a3c716e9686a4dea66ff023
Author: Lanqing Yang <[email protected]>
AuthorDate: Sun Feb 16 16:12:17 2025 -0800
ci: execute long running go tests in parallel (#2763)
Co-authored-by: Twice <[email protected]>
---
.github/workflows/kvrocks.yaml | 4 ++--
tests/gocase/integration/cluster/cluster_test.go | 7 +++++++
tests/gocase/integration/replication/replication_test.go | 13 +++++++++++++
tests/gocase/unit/config/config_test.go | 10 ++++++++++
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/kvrocks.yaml b/.github/workflows/kvrocks.yaml
index a355c4c6..2bc0834c 100644
--- a/.github/workflows/kvrocks.yaml
+++ b/.github/workflows/kvrocks.yaml
@@ -312,7 +312,7 @@ jobs:
cp minica.pem tests/gocase/tls/cert/ca.crt
GOCASE_RUN_ARGS="-tlsEnable"
fi
- ./x.py test go build $GOCASE_RUN_ARGS ${{ matrix.ignore_when_tsan}}
+ ./x.py test go build -parallel 2 $GOCASE_RUN_ARGS ${{
matrix.ignore_when_tsan}}
- name: Install redis-py
run: pip3 install redis==5.2.0
@@ -554,7 +554,7 @@ jobs:
run: |
export PATH=$PATH:$HOME/local/bin/
GOCASE_RUN_ARGS=""
- ./x.py test go build $GOCASE_RUN_ARGS
+ ./x.py test go build -parallel 2 $GOCASE_RUN_ARGS
- name: Install redis-py for openSUSE and Rocky
if: ${{ !startsWith(matrix.image, 'archlinux') &&
!startsWith(matrix.image, 'debian') && !startsWith(matrix.image, 'alpine') }}
diff --git a/tests/gocase/integration/cluster/cluster_test.go
b/tests/gocase/integration/cluster/cluster_test.go
index 05ec27f0..489fab26 100644
--- a/tests/gocase/integration/cluster/cluster_test.go
+++ b/tests/gocase/integration/cluster/cluster_test.go
@@ -33,6 +33,7 @@ import (
)
func TestDisableCluster(t *testing.T) {
+ t.Parallel()
srv := util.StartServer(t, map[string]string{})
defer srv.Close()
@@ -46,6 +47,7 @@ func TestDisableCluster(t *testing.T) {
}
func TestClusterKeySlot(t *testing.T) {
+ t.Parallel()
srv := util.StartServer(t, map[string]string{"cluster-enabled": "yes"})
defer srv.Close()
@@ -60,6 +62,7 @@ func TestClusterKeySlot(t *testing.T) {
}
func TestClusterNodes(t *testing.T) {
+ t.Parallel()
srv := util.StartServer(t, map[string]string{"cluster-enabled": "yes"})
defer srv.Close()
@@ -154,6 +157,7 @@ func TestClusterNodes(t *testing.T) {
}
func TestClusterReplicas(t *testing.T) {
+ t.Parallel()
ctx := context.Background()
srv1 := util.StartServer(t, map[string]string{"cluster-enabled": "yes"})
rdb1 := srv1.NewClient()
@@ -313,6 +317,7 @@ func TestClusterComplexTopology(t *testing.T) {
}
func TestClusterSlotSet(t *testing.T) {
+ t.Parallel()
ctx := context.Background()
srv1 := util.StartServer(t, map[string]string{"cluster-enabled": "yes"})
@@ -374,6 +379,7 @@ func TestClusterSlotSet(t *testing.T) {
}
func TestClusterMultiple(t *testing.T) {
+ t.Parallel()
ctx := context.Background()
var srv []*util.KvrocksServer
@@ -499,6 +505,7 @@ func TestClusterMultiple(t *testing.T) {
}
func TestClusterReset(t *testing.T) {
+ t.Parallel()
ctx := context.Background()
srv0 := util.StartServer(t, map[string]string{"cluster-enabled": "yes"})
diff --git a/tests/gocase/integration/replication/replication_test.go
b/tests/gocase/integration/replication/replication_test.go
index ac01e1b9..63c1ab2f 100644
--- a/tests/gocase/integration/replication/replication_test.go
+++ b/tests/gocase/integration/replication/replication_test.go
@@ -33,6 +33,7 @@ import (
)
func TestClusterReplication(t *testing.T) {
+ t.Parallel()
ctx := context.Background()
masterSrv := util.StartServer(t, map[string]string{"cluster-enabled":
"yes"})
@@ -91,6 +92,7 @@ func TestClusterReplication(t *testing.T) {
}
func TestReplicationWithHostname(t *testing.T) {
+ t.Parallel()
srvA := util.StartServer(t, map[string]string{})
defer srvA.Close()
rdbA := srvA.NewClient()
@@ -116,6 +118,7 @@ func TestReplicationWithHostname(t *testing.T) {
}
func TestReplicationLoading(t *testing.T) {
+ t.Parallel()
srvA := util.StartServer(t, map[string]string{})
defer srvA.Close()
rdbA := srvA.NewClient()
@@ -150,6 +153,7 @@ func TestReplicationLoading(t *testing.T) {
}
func TestReplicationBasics(t *testing.T) {
+ t.Parallel()
master := util.StartServer(t, map[string]string{})
defer master.Close()
masterClient := master.NewClient()
@@ -247,6 +251,7 @@ func TestReplicationBasics(t *testing.T) {
}
func TestReplicationWithMultiSlaves(t *testing.T) {
+ t.Parallel()
srvA := util.StartServer(t, map[string]string{})
defer srvA.Close()
rdbA := srvA.NewClient()
@@ -280,6 +285,7 @@ func TestReplicationWithMultiSlaves(t *testing.T) {
}
func TestReplicationWithLimitSpeed(t *testing.T) {
+ t.Parallel()
master := util.StartServer(t, map[string]string{
"max-replication-mb": "1",
"rocksdb.compression": "no",
@@ -329,6 +335,7 @@ func TestReplicationWithLimitSpeed(t *testing.T) {
}
func TestReplicationShareCheckpoint(t *testing.T) {
+ t.Parallel()
master := util.StartServer(t, map[string]string{})
defer master.Close()
masterClient := master.NewClient()
@@ -366,6 +373,7 @@ func TestReplicationShareCheckpoint(t *testing.T) {
}
func TestReplicationContinueRunning(t *testing.T) {
+ t.Parallel()
master := util.StartServer(t, map[string]string{})
defer master.Close()
masterClient := master.NewClient()
@@ -394,6 +402,7 @@ func TestReplicationContinueRunning(t *testing.T) {
}
func TestReplicationChangePassword(t *testing.T) {
+ t.Parallel()
master := util.StartServer(t, map[string]string{})
defer master.Close()
masterClient := master.NewClient()
@@ -436,6 +445,7 @@ func TestReplicationChangePassword(t *testing.T) {
}
func TestReplicationAnnounceIP(t *testing.T) {
+ t.Parallel()
master := util.StartServer(t, map[string]string{})
defer master.Close()
masterClient := master.NewClient()
@@ -481,6 +491,7 @@ func TestReplicationAnnounceIP(t *testing.T) {
}
func TestShouldNotReplicate(t *testing.T) {
+ t.Parallel()
master := util.StartServer(t, map[string]string{})
defer master.Close()
masterClient := master.NewClient()
@@ -510,6 +521,7 @@ func TestShouldNotReplicate(t *testing.T) {
}
func TestFullSyncReplication(t *testing.T) {
+ t.Parallel()
master := util.StartServer(t, map[string]string{
"rocksdb.write_buffer_size": "4",
"rocksdb.target_file_size_base": "16",
@@ -554,6 +566,7 @@ func TestFullSyncReplication(t *testing.T) {
}
func TestSlaveLostMaster(t *testing.T) {
+ t.Parallel()
// integration test for #2662 and #2671
ctx := context.Background()
diff --git a/tests/gocase/unit/config/config_test.go
b/tests/gocase/unit/config/config_test.go
index f599d905..827cd291 100644
--- a/tests/gocase/unit/config/config_test.go
+++ b/tests/gocase/unit/config/config_test.go
@@ -36,6 +36,7 @@ import (
)
func TestRenameCommand(t *testing.T) {
+ t.Parallel()
srv := util.StartServer(t, map[string]string{
"resp3-enabled": "no",
"rename-command KEYS": "KEYSNEW",
@@ -62,6 +63,7 @@ func TestRenameCommand(t *testing.T) {
}
func TestSetConfigBackupDir(t *testing.T) {
+ t.Parallel()
configs := map[string]string{}
srv := util.StartServer(t, configs)
defer srv.Close()
@@ -109,6 +111,7 @@ func TestSetConfigBackupDir(t *testing.T) {
}
func TestConfigSetCompression(t *testing.T) {
+ t.Parallel()
configs := map[string]string{}
srv := util.StartServer(t, configs)
defer srv.Close()
@@ -130,6 +133,7 @@ func TestConfigSetCompression(t *testing.T) {
}
func TestConfigGetRESP3(t *testing.T) {
+ t.Parallel()
srv := util.StartServer(t, map[string]string{
"resp3-enabled": "yes",
})
@@ -143,6 +147,7 @@ func TestConfigGetRESP3(t *testing.T) {
}
func TestStartWithoutConfigurationFile(t *testing.T) {
+ t.Parallel()
srv := util.StartServerWithCLIOptions(t, false, map[string]string{},
[]string{})
defer srv.Close()
@@ -155,6 +160,7 @@ func TestStartWithoutConfigurationFile(t *testing.T) {
}
func TestDynamicChangeWorkerThread(t *testing.T) {
+ t.Parallel()
configs := map[string]string{}
srv := util.StartServer(t, configs)
defer srv.Close()
@@ -243,6 +249,7 @@ func TestDynamicChangeWorkerThread(t *testing.T) {
}
func TestChangeProtoMaxBulkLen(t *testing.T) {
+ t.Parallel()
configs := map[string]string{}
srv := util.StartServer(t, configs)
defer srv.Close()
@@ -273,6 +280,7 @@ func TestChangeProtoMaxBulkLen(t *testing.T) {
}
func TestGetConfigTxnContext(t *testing.T) {
+ t.Parallel()
srv := util.StartServer(t, map[string]string{
"txn-context-enabled": "yes",
})
@@ -294,6 +302,7 @@ func TestGetConfigTxnContext(t *testing.T) {
}
func TestGenerateConfigsMatrix(t *testing.T) {
+ t.Parallel()
configOptions := []util.ConfigOptions{
{
Name: "txn-context-enabled",
@@ -318,6 +327,7 @@ func TestGenerateConfigsMatrix(t *testing.T) {
}
func TestGetConfigSkipBlockCacheDeallocationOnClose(t *testing.T) {
+ t.Parallel()
srv := util.StartServer(t, map[string]string{
"skip-block-cache-deallocation-on-close": "yes",
})