mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 20:59:53 +05:00
Fixed cores tests + apis stop args
This commit is contained in:
committed by
Dan Christian Bogos
parent
7bcdf68116
commit
56fbe5fa60
@@ -62,7 +62,7 @@ func (cS *CoreSv1) StartCPUProfiling(_ *context.Context, args *utils.DirectoryAr
|
||||
|
||||
// StopCPUProfiling is used to stop CPUProfiling. The file should be written on the path
|
||||
// where the CPUProfiling already started
|
||||
func (cS *CoreSv1) StopCPUProfiling(_ *context.Context, _ *utils.DirectoryArgs, reply *string) error {
|
||||
func (cS *CoreSv1) StopCPUProfiling(_ *context.Context, _ *utils.TenantWithAPIOpts, reply *string) error {
|
||||
if err := cS.cS.StopCPUProfiling(); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -81,7 +81,7 @@ func (cS *CoreSv1) StartMemoryProfiling(_ *context.Context, args *utils.MemoryPr
|
||||
|
||||
// StopMemoryProfiling is used to stop MemoryProfiling. The file should be written on the path
|
||||
// where the MemoryProfiling already started
|
||||
func (cS *CoreSv1) StopMemoryProfiling(_ *context.Context, _ *utils.MemoryPrf, reply *string) error {
|
||||
func (cS *CoreSv1) StopMemoryProfiling(_ *context.Context, _ *utils.TenantWithAPIOpts, reply *string) error {
|
||||
if err := cS.cS.StopMemoryProfiling(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ func testCoreItStopMemProfilingBeforeStart(t *testing.T) {
|
||||
var reply string
|
||||
expectedErr := " Memory Profiling is not started"
|
||||
if err := coreSBiRpc.Call(context.Background(), utils.CoreSv1StopMemoryProfiling,
|
||||
new(utils.MemoryPrf), &reply); err == nil || err.Error() != expectedErr {
|
||||
new(utils.TenantWithAPIOpts), &reply); err == nil || err.Error() != expectedErr {
|
||||
t.Errorf("Expected %+q, received %+q", expectedErr, err)
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ func testCoreItStartEngineByExecWIthMemProfiling(t *testing.T) {
|
||||
func testCoreItStopMemoryProfiling(t *testing.T) {
|
||||
var reply string
|
||||
if err := coreSBiRpc.Call(context.Background(), utils.CoreSv1StopMemoryProfiling,
|
||||
new(utils.MemoryPrf), &reply); err != nil {
|
||||
new(utils.TenantWithAPIOpts), &reply); err != nil {
|
||||
t.Error(err)
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Unexpected reply returned")
|
||||
@@ -272,7 +272,7 @@ func testCoreItStopCPUProfilingBeforeStart(t *testing.T) {
|
||||
var reply string
|
||||
expectedErr := " cannot stop because CPUProfiling is not active"
|
||||
if err := coreSBiRpc.Call(context.Background(), utils.CoreSv1StopCPUProfiling,
|
||||
new(utils.DirectoryArgs), &reply); err == nil || err.Error() != expectedErr {
|
||||
new(utils.TenantWithAPIOpts), &reply); err == nil || err.Error() != expectedErr {
|
||||
t.Errorf("Expected %+q, received %+q", expectedErr, err)
|
||||
}
|
||||
}
|
||||
@@ -306,7 +306,7 @@ func testCoreItSleep(t *testing.T) {
|
||||
func testCoreItStopCPUProfiling(t *testing.T) {
|
||||
var reply string
|
||||
if err := coreSBiRpc.Call(context.Background(), utils.CoreSv1StopCPUProfiling,
|
||||
new(utils.DirectoryArgs), &reply); err != nil {
|
||||
new(utils.TenantIDWithAPIOpts), &reply); err != nil {
|
||||
t.Error(err)
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Unexpected reply returned")
|
||||
@@ -356,8 +356,10 @@ func testCoreItStatus(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func testCoreItKillEngine(t *testing.T) {
|
||||
if err := engine.KillEngine(*waitRater); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
time.Sleep(500*time.Millisecond)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user