From 68eff7b5912d2745b65018780d6901c52104765c Mon Sep 17 00:00:00 2001 From: Blaine Gardner Date: Tue, 17 Dec 2024 10:08:52 -0700 Subject: [PATCH] test: fix flaky object config unit test Use testify/assert.Equal() to compare maps. Comparing string representations of maps is supposed to be stable but is flaking in GH actions CI. Signed-off-by: Blaine Gardner (cherry picked from commit 92c95fcc16c102e31668dc8fd272d9262f48cb0f) --- pkg/operator/ceph/object/config_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/operator/ceph/object/config_test.go b/pkg/operator/ceph/object/config_test.go index d0ba361c2..89c82eef5 100644 --- a/pkg/operator/ceph/object/config_test.go +++ b/pkg/operator/ceph/object/config_test.go @@ -17,7 +17,6 @@ limitations under the License. package object import ( - "fmt" "testing" cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" @@ -178,7 +177,7 @@ func Test_clusterConfig_generateMonConfigOptions(t *testing.T) { t.Errorf("clusterConfig.generateMonConfigOptions() error = %v, wantErr %v", err, tt.wantErr) return } - assert.Equal(t, fmt.Sprint(tt.want), fmt.Sprint(got)) // go maps are stringified in sorted order for testing + assert.Equal(t, tt.want, got) }) } }