Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Simplifying overengineered test
Browse files Browse the repository at this point in the history
  • Loading branch information
iwankgb committed Jan 25, 2017
1 parent ae128e4 commit 2752f9c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions mgmt/rest/client/client_func_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,7 @@ func TestSnapClient(t *testing.T) {
c, err = New("http://127.0.0.1:65000", "", true, Timeout(time.Second))
Convey("Client should timeout", t, func() {
So(err, ShouldBeNil)
var r *GetTasksResult
go func() {
r = c.GetTasks()
}()
time.Sleep(3 * time.Second)
So(r, ShouldNotBeNil)
r := c.GetTasks()
So(r.Err, ShouldNotBeNil)
})
}
Expand All @@ -647,6 +642,6 @@ type timeoutHandler struct{}

//ServeHTTP implements http.Handler interface
func (th timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
time.Sleep(15 * time.Second)
time.Sleep(3 * time.Second)
w.Write([]byte("Hello!"))
}

0 comments on commit 2752f9c

Please sign in to comment.