From b40b7eb363f1f144f360dc1bd31ad537707cd7a4 Mon Sep 17 00:00:00 2001 From: TeoV Date: Thu, 23 Apr 2020 17:34:59 +0300 Subject: [PATCH] Add CacheStir in DefaultCache --- apier/v1/precache_it_test.go | 8 ++++++-- engine/libtest.go | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apier/v1/precache_it_test.go b/apier/v1/precache_it_test.go index 86106a777..1e5c24ef3 100644 --- a/apier/v1/precache_it_test.go +++ b/apier/v1/precache_it_test.go @@ -124,7 +124,7 @@ func testPrecacheGetCacheStatsBeforeLoad(t *testing.T) { if err := precacheRPC.Call(utils.CacheSv1GetCacheStats, args, &reply); err != nil { t.Error(err.Error()) } else if !reflect.DeepEqual(reply, expectedStats) { - t.Errorf("Expecting : %+v, received: %+v", utils.ToJSON(expectedStats), utils.ToJSON(reply)) + t.Errorf("Expecting : %+v,\n received: %+v", utils.ToJSON(expectedStats), utils.ToJSON(reply)) } } @@ -270,6 +270,10 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Items: 1, Groups: 0, }, + utils.CacheSTIR: { + Items: 0, + Groups: 0, + }, utils.CacheSupplierFilterIndexes: { Items: 6, Groups: 0, @@ -326,7 +330,7 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { if err := precacheRPC.Call(utils.CacheSv1GetCacheStats, args, &reply); err != nil { t.Error(err.Error()) } else if !reflect.DeepEqual(reply, expectedStats) { - t.Errorf("Expecting : %+v, received: %+v", utils.ToJSON(expectedStats), utils.ToJSON(reply)) + t.Errorf("Expecting : %+v, \n received: %+v", utils.ToJSON(expectedStats), utils.ToJSON(reply)) } } diff --git a/engine/libtest.go b/engine/libtest.go index 84336ffde..8c12503ce 100644 --- a/engine/libtest.go +++ b/engine/libtest.go @@ -581,6 +581,10 @@ func GetDefaultEmptyCacheStats() map[string]*ltcache.CacheStats { Items: 0, Groups: 0, }, + utils.CacheSTIR: { + Items: 0, + Groups: 0, + }, utils.CacheSupplierFilterIndexes: { Items: 0, Groups: 0,