diff --git a/apier/v1/precache_it_test.go b/apier/v1/precache_it_test.go index 83bbb1bc1..f9ed59e3c 100644 --- a/apier/v1/precache_it_test.go +++ b/apier/v1/precache_it_test.go @@ -46,9 +46,9 @@ var ( var sTestsPrecache = []func(t *testing.T){ testPrecacheInitCfg, testPrecacheResetDataDB, - //testPrecacheStartEngine, + testPrecacheStartEngine, testPrecacheRpcConn, - // testPrecacheGetCacheStatsBeforeLoad, + testPrecacheGetCacheStatsBeforeLoad, testPrecacheFromFolder, testPrecacheRestartEngine, testPrecacheGetItemIDs, @@ -112,11 +112,9 @@ func testPrecacheGetItemIDs(t *testing.T) { CacheID: "*default", } var reply *[]string - expected := []string{} - if err := precacheRPC.Call(utils.CacheSv1GetItemIDs, args, &reply); err != nil { - t.Error(err.Error()) - } else if !reflect.DeepEqual(reply, expected) { - t.Errorf("Expecting : %+v, received: %+v", utils.ToJSON(expected), utils.ToJSON(reply)) + if err := precacheRPC.Call(utils.CacheSv1GetItemIDs, args, &reply); err == nil || + err.Error() != utils.ErrNotFound.Error() { + t.Error(err) } } @@ -125,7 +123,7 @@ func testPrecacheGetCacheStatsBeforeLoad(t *testing.T) { cacheIDs := []string{} expectedStats := &map[string]*ltcache.CacheStats{ "*default": <cache.CacheStats{ - Items: 1, + Items: 0, Groups: 0, }, "account_action_plans": <cache.CacheStats{ @@ -301,11 +299,11 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { cacheIDs := []string{} expectedStats := &map[string]*ltcache.CacheStats{ "*default": <cache.CacheStats{ - Items: 1, + Items: 0, Groups: 0, }, "account_action_plans": <cache.CacheStats{ - Items: 5, + Items: 7, Groups: 0, }, "action_plans": <cache.CacheStats{ @@ -345,7 +343,7 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Groups: 0, }, "destinations": <cache.CacheStats{ - Items: 5, + Items: 8, Groups: 0, }, "event_resources": <cache.CacheStats{ @@ -353,7 +351,7 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Groups: 0, }, "filters": <cache.CacheStats{ - Items: 16, // expected to have 16 items + Items: 20, // expected to have 16 items Groups: 0, }, "lcr_rules": <cache.CacheStats{ @@ -361,11 +359,11 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Groups: 0, }, "rating_plans": <cache.CacheStats{ - Items: 4, // expected to have 4 items + Items: 6, // expected to have 4 items Groups: 0, }, "rating_profiles": <cache.CacheStats{ - Items: 10, // expected to have 10 items + Items: 12, // expected to have 10 items Groups: 0, }, "resource_filter_indexes": <cache.CacheStats{ @@ -377,11 +375,11 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Groups: 0, }, "resource_profiles": <cache.CacheStats{ - Items: 3, + Items: 4, Groups: 0, }, "resources": <cache.CacheStats{ - Items: 3, //expected to have 3 items + Items: 4, //expected to have 3 items Groups: 0, }, "reverse_aliases": <cache.CacheStats{ @@ -389,7 +387,7 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Groups: 0, }, "reverse_destinations": <cache.CacheStats{ - Items: 7, + Items: 10, Groups: 0, }, "shared_groups": <cache.CacheStats{ @@ -405,11 +403,11 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Groups: 0, }, "statqueue_profiles": <cache.CacheStats{ - Items: 1, + Items: 2, Groups: 0, }, "statqueues": <cache.CacheStats{ - Items: 1, // expected to have 1 item + Items: 2, // expected to have 1 item Groups: 0, }, "supplier_filter_indexes": <cache.CacheStats{ @@ -421,7 +419,7 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Groups: 0, }, "supplier_profiles": <cache.CacheStats{ - Items: 3, // expected to have 3 items + Items: 4, // expected to have 3 items Groups: 0, }, "threshold_filter_indexes": <cache.CacheStats{ @@ -433,11 +431,11 @@ func testPrecacheGetCacheStatsAfterRestart(t *testing.T) { Groups: 0, }, "threshold_profiles": <cache.CacheStats{ - Items: 7, + Items: 9, Groups: 0, }, "thresholds": <cache.CacheStats{ - Items: 7, // expected to have 7 items + Items: 9, // expected to have 7 items Groups: 0, }, "timings": <cache.CacheStats{ diff --git a/cmd/cgr-engine/cgr-engine.go b/cmd/cgr-engine/cgr-engine.go index a3060e23f..44ba4a72d 100644 --- a/cmd/cgr-engine/cgr-engine.go +++ b/cmd/cgr-engine/cgr-engine.go @@ -469,12 +469,13 @@ func startPubSubServer(internalPubSubSChan chan rpcclient.RpcClientConnection, d func startAliasesServer(internalAliaseSChan chan rpcclient.RpcClientConnection, dm *engine.DataManager, server *utils.Server, exitChan chan bool) { aliasesServer := engine.NewAliasHandler(dm) server.RpcRegisterName("AliasesV1", aliasesServer) - loadHist, err := dm.DataDB().GetLoadHistory(1, true, utils.NonTransactional) + /*loadHist, err := dm.DataDB().GetLoadHistory(1, true, utils.NonTransactional) if err != nil || len(loadHist) == 0 { utils.Logger.Info(fmt.Sprintf("could not get load history: %v (%v)", loadHist, err)) internalAliaseSChan <- aliasesServer return } + */ internalAliaseSChan <- aliasesServer }