From fc5b33736a12c18c7bc828be9551bae49d0101df Mon Sep 17 00:00:00 2001 From: Hunter Long Date: Thu, 29 Nov 2018 11:07:29 -0800 Subject: [PATCH] test wait time increased --- cmd/cli_test.go | 4 ++-- handlers/api.go | 2 -- handlers/handlers_test.go | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/cli_test.go b/cmd/cli_test.go index 7cc6584c..e802f086 100644 --- a/cmd/cli_test.go +++ b/cmd/cli_test.go @@ -74,7 +74,7 @@ func TestExportCommand(t *testing.T) { func TestUpdateCommand(t *testing.T) { cmd := helperCommand(nil, "version") var got = make(chan string) - commandAndSleep(cmd, time.Duration(10*time.Second), got) + commandAndSleep(cmd, time.Duration(15*time.Second), got) gg, _ := <-got t.Log(gg) assert.Contains(t, gg, "Statup") @@ -92,7 +92,7 @@ func TestAssetsCommand(t *testing.T) { func TestRunCommand(t *testing.T) { cmd := helperCommand(nil, "run") var got = make(chan string) - commandAndSleep(cmd, time.Duration(5*time.Second), got) + commandAndSleep(cmd, time.Duration(15*time.Second), got) gg, _ := <-got t.Log(gg) assert.Contains(t, gg, "Running 1 time and saving to database...") diff --git a/handlers/api.go b/handlers/api.go index f0a1fd0f..ea96de7d 100644 --- a/handlers/api.go +++ b/handlers/api.go @@ -68,7 +68,6 @@ func sendErrorJson(err error, w http.ResponseWriter, r *http.Request) { Status: "error", Error: err.Error(), } - r.Body.Close() w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(output) } @@ -118,7 +117,6 @@ func sendJsonAction(obj interface{}, method string, w http.ResponseWriter, r *ht Output: obj, } - r.Body.Close() w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(output) } diff --git a/handlers/handlers_test.go b/handlers/handlers_test.go index 0090b3ef..a701d108 100644 --- a/handlers/handlers_test.go +++ b/handlers/handlers_test.go @@ -460,7 +460,7 @@ func TestSaveSassHandler(t *testing.T) { func TestReorderServiceHandler(t *testing.T) { data := `[{id: 1, order: 3},{id: 2, order: 2},{id: 3, order: 1}]"` - req, err := http.NewRequest("POST", "/services/reorder", strings.NewReader(data)) + req, err := http.NewRequest("POST", "/api/services/reorder", strings.NewReader(data)) req.Header.Set("Content-Type", "application/json") assert.Nil(t, err) rr := httptest.NewRecorder()