Skip to content

Commit 9d8f7ce

Browse files
test: enable parallel execution for MultigresCluster controller tests
Adds `t.Parallel()` to `TestMultigresClusterReconciler_Reconcile` and its subtests, as well as other unit tests in the MultigresCluster controller test suite. This allows independent test cases to run concurrently, reducing the overall execution time of the test suite.
1 parent c86eb45 commit 9d8f7ce

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/cluster-handler/controller/multigrescluster/multigrescluster_controller_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
)
2828

2929
func TestMultigresClusterReconciler_Reconcile(t *testing.T) {
30+
t.Parallel()
31+
3032
scheme := runtime.NewScheme()
3133
_ = multigresv1alpha1.AddToScheme(scheme)
3234
_ = appsv1.AddToScheme(scheme)
@@ -1004,6 +1006,8 @@ func TestMultigresClusterReconciler_Reconcile(t *testing.T) {
10041006

10051007
for name, tc := range tests {
10061008
t.Run(name, func(t *testing.T) {
1009+
t.Parallel()
1010+
10071011
clientBuilder := fake.NewClientBuilder().
10081012
WithScheme(scheme).
10091013
WithObjects(tc.existingObjects...).
@@ -1061,6 +1065,8 @@ func TestMultigresClusterReconciler_Reconcile(t *testing.T) {
10611065
}
10621066

10631067
func TestSetupWithManager_Coverage(t *testing.T) {
1068+
t.Parallel()
1069+
10641070
defer func() {
10651071
if r := recover(); r != nil {
10661072
// Expected panic
@@ -1071,7 +1077,11 @@ func TestSetupWithManager_Coverage(t *testing.T) {
10711077
}
10721078

10731079
func TestTemplateLogic_Unit(t *testing.T) {
1080+
t.Parallel()
1081+
10741082
t.Run("MergeCellConfig", func(t *testing.T) {
1083+
t.Parallel()
1084+
10751085
tpl := &multigresv1alpha1.CellTemplate{
10761086
Spec: multigresv1alpha1.CellTemplateSpec{
10771087
MultiGateway: &multigresv1alpha1.StatelessSpec{
@@ -1155,6 +1165,8 @@ func TestTemplateLogic_Unit(t *testing.T) {
11551165
})
11561166

11571167
t.Run("MergeShardConfig", func(t *testing.T) {
1168+
t.Parallel()
1169+
11581170
tpl := &multigresv1alpha1.ShardTemplate{
11591171
Spec: multigresv1alpha1.ShardTemplateSpec{
11601172
MultiOrch: &multigresv1alpha1.MultiOrchSpec{
@@ -1233,6 +1245,8 @@ func TestTemplateLogic_Unit(t *testing.T) {
12331245
})
12341246

12351247
t.Run("ResolveGlobalTopo", func(t *testing.T) {
1248+
t.Parallel()
1249+
12361250
spec := &multigresv1alpha1.GlobalTopoServerSpec{TemplateRef: "t1"}
12371251
core := &multigresv1alpha1.CoreTemplate{
12381252
Spec: multigresv1alpha1.CoreTemplateSpec{
@@ -1258,6 +1272,8 @@ func TestTemplateLogic_Unit(t *testing.T) {
12581272
})
12591273

12601274
t.Run("ResolveMultiAdmin", func(t *testing.T) {
1275+
t.Parallel()
1276+
12611277
spec := &multigresv1alpha1.MultiAdminConfig{TemplateRef: "t1"}
12621278
core := &multigresv1alpha1.CoreTemplate{
12631279
Spec: multigresv1alpha1.CoreTemplateSpec{

0 commit comments

Comments
 (0)