mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
* group read comparison settings during app reconciliation * Reduce lock contention in clusterInfo::ensureSynced(). Add getRepoObj stats * Remove additional source of lock contention * Exclude the coordination.k8s.io/Lease resource Co-authored-by: Alexander Matyushentsev <amatyushentsev@gmail.com>
26 lines
486 B
Go
26 lines
486 B
Go
package cache
|
|
|
|
import (
|
|
"sync"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestGetServerVersion(t *testing.T) {
|
|
now := time.Now()
|
|
cache := &liveStateCache{
|
|
lock: &sync.RWMutex{},
|
|
clusters: map[string]*clusterInfo{
|
|
"http://localhost": {
|
|
syncTime: &now,
|
|
lock: &sync.RWMutex{},
|
|
serverVersion: "123",
|
|
},
|
|
}}
|
|
|
|
version, err := cache.GetServerVersion("http://localhost")
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, "123", version)
|
|
}
|