From c760d5910f98f6c9cc5ba4c2a9a54e42db3b6595 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Sat, 28 May 2016 20:03:52 -0700 Subject: [PATCH] Renamed error message in alloc endpoint --- client/driver/docker_test.go | 3 --- client/task_runner.go | 2 +- command/agent/alloc_endpoint.go | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/driver/docker_test.go b/client/driver/docker_test.go index 703e3e4a2fa..ab97fc9cd33 100644 --- a/client/driver/docker_test.go +++ b/client/driver/docker_test.go @@ -837,11 +837,8 @@ func TestDockerDriver_Stats(t *testing.T) { defer cleanup() go func() { - fmt.Println("GOING TO SLEEP") time.Sleep(3 * time.Second) - fmt.Println("COMING OUT OF SLEEP") ru, err := handle.Stats() - fmt.Printf("STATS CALL OVER ru: %#v, err: %v", ru, err) if err != nil { t.Fatalf("err: %v", err) } diff --git a/client/task_runner.go b/client/task_runner.go index 62a379f3240..370775801be 100644 --- a/client/task_runner.go +++ b/client/task_runner.go @@ -508,7 +508,7 @@ func (r *TaskRunner) ResourceUsageTS(since int64) []*cstructs.TaskResourceUsage var idx int for { - mid := (low + high) >> 1 + mid := (low + high) / 2 midVal, _ := values[mid].(*cstructs.TaskResourceUsage) if midVal.Timestamp < since { low = mid + 1 diff --git a/command/agent/alloc_endpoint.go b/command/agent/alloc_endpoint.go index 53f4213645e..8fe63ce7916 100644 --- a/command/agent/alloc_endpoint.go +++ b/command/agent/alloc_endpoint.go @@ -10,7 +10,7 @@ import ( ) const ( - urlNotFoundErr = "url not found" + allocNotFoundErr = "allocation not found" ) func (s *HTTPServer) AllocsRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) { @@ -71,7 +71,7 @@ func (s *HTTPServer) ClientAllocRequest(resp http.ResponseWriter, req *http.Requ // invoked on the alloc id tokens := strings.Split(reqSuffix, "/") if len(tokens) == 1 || tokens[1] != "stats" { - return nil, CodedError(404, urlNotFoundErr) + return nil, CodedError(404, allocNotFoundErr) } allocID := tokens[0]