diff --git a/apier/v2/tp_it_test.go b/apier/v2/tp_it_test.go index e65fd25d9..af5ad3e8c 100644 --- a/apier/v2/tp_it_test.go +++ b/apier/v2/tp_it_test.go @@ -53,7 +53,7 @@ var sTestsTutIT = []func(t *testing.T){ testTPitRpcConn, testTPitTimings, testTPitDestinations, - // ToDo: test engine shutdown + testTPitKillEngine, } // Tests starting here @@ -256,3 +256,8 @@ func testTPitDestinations(t *testing.T) { t.Errorf("Calling ApierV2.GetTPDestinationIDs expected: %v, received: %v", expectedDstIds, rplyDstIds) } } +func testTPitKillEngine(t *testing.T) { + if err := engine.KillEngine(100); err != nil { + t.Error(err) + } +} diff --git a/engine/actions_it_test.go b/engine/actions_it_test.go index 0e79a94e0..e6cf0fbce 100644 --- a/engine/actions_it_test.go +++ b/engine/actions_it_test.go @@ -37,7 +37,7 @@ var actsLclCfg *config.CGRConfig var actsLclRpc *rpc.Client var actsLclCfgPath = path.Join(*dataDir, "conf", "samples", "actions") -var waitRater = flag.Int("wait_rater", 100, "Number of miliseconds to wait for rater to start and cache") +var waitRater = flag.Int("wait_rater", 500, "Number of miliseconds to wait for rater to start and cache") func TestActionsitInitCfg(t *testing.T) { // Init config first @@ -61,7 +61,7 @@ func TestActionsitInitCdrDb(t *testing.T) { // Finds cgr-engine executable and starts it with default configuration func TestActionsitStartEngine(t *testing.T) { - if _, err := StartEngine(actsLclCfgPath, *waitRater); err != nil { + if _, err := StopStartEngine(actsLclCfgPath, *waitRater); err != nil { t.Fatal(err) } } @@ -69,7 +69,7 @@ func TestActionsitStartEngine(t *testing.T) { // Connect rpc client to rater func TestActionsitRpcConn(t *testing.T) { var err error - time.Sleep(500 * time.Millisecond) + // time.Sleep(500 * time.Millisecond) actsLclRpc, err = jsonrpc.Dial("tcp", actsLclCfg.ListenCfg().RPCJSONListen) // We connect over JSON so we can also troubleshoot if needed if err != nil { t.Fatal(err)