mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 06:09:53 +05:00
Updated engine tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
a79f1d33aa
commit
49b2eb4943
@@ -994,10 +994,14 @@ func (cfg *CGRConfig) checkConfigSanity() error {
|
||||
}
|
||||
}
|
||||
}
|
||||
for cacheID := range cfg.cacheCfg.Partitions {
|
||||
for cacheID, itm := range cfg.cacheCfg.Partitions {
|
||||
if !utils.CachePartitions.Has(cacheID) {
|
||||
return fmt.Errorf("<%s> partition <%s> not defined", utils.CacheS, cacheID)
|
||||
}
|
||||
if cacheID == utils.CacheRPCConnections &&
|
||||
itm.Replicate {
|
||||
return fmt.Errorf("<%s> partition <%s> does not support replication", utils.CacheS, cacheID) // deadlock prevention
|
||||
}
|
||||
}
|
||||
// FilterS sanity check
|
||||
for _, connID := range cfg.filterSCfg.StatSConns {
|
||||
|
||||
@@ -22,7 +22,6 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/config"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
@@ -594,35 +593,26 @@ func TestCMReload(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
func TestCMDeadLock(t *testing.T) {
|
||||
// to not break the next tests reset the values
|
||||
tCh := Cache
|
||||
tCfg := config.CgrConfig()
|
||||
tCM := connMgr
|
||||
defer func() {
|
||||
Cache = tCh
|
||||
config.SetCgrConfig(tCfg)
|
||||
connMgr = tCM
|
||||
}()
|
||||
|
||||
cfg := config.NewDefaultCGRConfig()
|
||||
// define a dummy replication conn
|
||||
cfg.CacheCfg().ReplicationConns = []string{"test"}
|
||||
cfg.CacheCfg().Partitions[utils.CacheRPCConnections].Replicate = true
|
||||
cfg.CacheCfg().Partitions[utils.CacheStatQueueProfiles].Replicate = true
|
||||
cfg.RPCConns()["test"] = &config.RPCConn{Conns: []*config.RemoteHost{{}}}
|
||||
config.SetCgrConfig(cfg)
|
||||
|
||||
Cache = NewCacheS(cfg, nil, nil)
|
||||
|
||||
iCh := make(chan rpcclient.ClientConnector, 1)
|
||||
iCn := utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCaches)
|
||||
iCh <- Cache
|
||||
connMgr = NewConnManager(cfg, map[string]chan rpcclient.ClientConnector{iCn: iCh})
|
||||
|
||||
var reply string
|
||||
connMgr.Call([]string{iCn}, nil, utils.CacheSv1Clear,
|
||||
new(utils.AttrCacheIDsWithAPIOpts), &reply) // just cache a connection
|
||||
|
||||
Cache.SetWithoutReplicate(utils.CacheStatQueueProfiles, "", nil, nil, true, utils.NonTransactional)
|
||||
done := make(chan struct{}) // signal
|
||||
|
||||
go func() {
|
||||
@@ -635,3 +625,4 @@ func TestCMDeadLock(t *testing.T) {
|
||||
t.Fatal("Deadlock on cache")
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user