From 278a47a801098aa894df887b57ceb9bcbe54f82b Mon Sep 17 00:00:00 2001 From: shota3506 Date: Sun, 12 Oct 2025 12:29:33 +0900 Subject: [PATCH] chore: remove unnecessary lock value copy in test Signed-off-by: shota3506 --- controller/cache/cache_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/controller/cache/cache_test.go b/controller/cache/cache_test.go index 7142b9c16052c..2072981cdd2f6 100644 --- a/controller/cache/cache_test.go +++ b/controller/cache/cache_test.go @@ -172,7 +172,6 @@ func TestHandleDeleteEvent_CacheDeadlock(t *testing.T) { db.On("GetApplicationControllerReplicas").Return(1) fakeClient := fake.NewClientset() settingsMgr := argosettings.NewSettingsManager(t.Context(), fakeClient, "argocd") - liveStateCacheLock := sync.RWMutex{} gitopsEngineClusterCache := &mocks.ClusterCache{} clustersCache := liveStateCache{ clusters: map[string]cache.ClusterCache{ @@ -180,9 +179,7 @@ func TestHandleDeleteEvent_CacheDeadlock(t *testing.T) { }, clusterSharding: sharding.NewClusterSharding(db, 0, 1, common.DefaultShardingAlgorithm), settingsMgr: settingsMgr, - // Set the lock here so we can reference it later - //nolint:govet // We need to overwrite here to have access to the lock - lock: liveStateCacheLock, + lock: sync.RWMutex{}, } channel := make(chan string) // Mocked lock held by the gitops-engine cluster cache