test wait time increased

pull/109/head
Hunter Long 2018-11-29 11:07:29 -08:00
parent d29d134372
commit fc5b33736a
3 changed files with 3 additions and 5 deletions

View File

@ -74,7 +74,7 @@ func TestExportCommand(t *testing.T) {
func TestUpdateCommand(t *testing.T) { func TestUpdateCommand(t *testing.T) {
cmd := helperCommand(nil, "version") cmd := helperCommand(nil, "version")
var got = make(chan string) var got = make(chan string)
commandAndSleep(cmd, time.Duration(10*time.Second), got) commandAndSleep(cmd, time.Duration(15*time.Second), got)
gg, _ := <-got gg, _ := <-got
t.Log(gg) t.Log(gg)
assert.Contains(t, gg, "Statup") assert.Contains(t, gg, "Statup")
@ -92,7 +92,7 @@ func TestAssetsCommand(t *testing.T) {
func TestRunCommand(t *testing.T) { func TestRunCommand(t *testing.T) {
cmd := helperCommand(nil, "run") cmd := helperCommand(nil, "run")
var got = make(chan string) var got = make(chan string)
commandAndSleep(cmd, time.Duration(5*time.Second), got) commandAndSleep(cmd, time.Duration(15*time.Second), got)
gg, _ := <-got gg, _ := <-got
t.Log(gg) t.Log(gg)
assert.Contains(t, gg, "Running 1 time and saving to database...") assert.Contains(t, gg, "Running 1 time and saving to database...")

View File

@ -68,7 +68,6 @@ func sendErrorJson(err error, w http.ResponseWriter, r *http.Request) {
Status: "error", Status: "error",
Error: err.Error(), Error: err.Error(),
} }
r.Body.Close()
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(output) json.NewEncoder(w).Encode(output)
} }
@ -118,7 +117,6 @@ func sendJsonAction(obj interface{}, method string, w http.ResponseWriter, r *ht
Output: obj, Output: obj,
} }
r.Body.Close()
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(output) json.NewEncoder(w).Encode(output)
} }

View File

@ -460,7 +460,7 @@ func TestSaveSassHandler(t *testing.T) {
func TestReorderServiceHandler(t *testing.T) { func TestReorderServiceHandler(t *testing.T) {
data := `[{id: 1, order: 3},{id: 2, order: 2},{id: 3, order: 1}]"` 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") req.Header.Set("Content-Type", "application/json")
assert.Nil(t, err) assert.Nil(t, err)
rr := httptest.NewRecorder() rr := httptest.NewRecorder()