diff --git a/apis/cores.go b/apis/cores.go index fd591738a..59202ddb8 100644 --- a/apis/cores.go +++ b/apis/cores.go @@ -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 } diff --git a/apis/cores_it_test.go b/apis/cores_it_test.go index 02b0d5dea..3ce05a30e 100644 --- a/apis/cores_it_test.go +++ b/apis/cores_it_test.go @@ -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) }