chore: remove unnecessary lock value copy in test (#24939)

Signed-off-by: shota3506 <s.shota.710.3506@gmail.com>
This commit is contained in:
Shota Sugiura
2025-10-24 02:00:50 +09:00
committed by GitHub
parent 97d50a14a6
commit 541a1546cd

View File

@@ -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