summaryrefslogtreecommitdiff
path: root/service/http/rpc_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/http/rpc_test.go')
-rw-r--r--service/http/rpc_test.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/service/http/rpc_test.go b/service/http/rpc_test.go
index f7be3c70..1e5a18aa 100644
--- a/service/http/rpc_test.go
+++ b/service/http/rpc_test.go
@@ -55,10 +55,13 @@ func Test_RPC(t *testing.T) {
t.Errorf("error during the Serve: error %v", err)
}
}()
- time.Sleep(time.Millisecond * 100)
- defer c.Stop()
- res, _, _ := get("http://localhost:6029")
+ time.Sleep(time.Second)
+
+ res, _, err := get("http://localhost:6029")
+ if err != nil {
+ t.Fatal(err)
+ }
assert.Equal(t, strconv.Itoa(*ss.rr.Workers()[0].Pid), res)
cl, err := rs.Client()
@@ -68,9 +71,13 @@ func Test_RPC(t *testing.T) {
assert.NoError(t, cl.Call("http.Reset", true, &r))
assert.Equal(t, "OK", r)
- res2, _, _ := get("http://localhost:6029")
+ res2, _, err := get("http://localhost:6029")
+ if err != nil {
+ t.Fatal()
+ }
assert.Equal(t, strconv.Itoa(*ss.rr.Workers()[0].Pid), res2)
assert.NotEqual(t, res, res2)
+ c.Stop()
}
func Test_RPC_Unix(t *testing.T) {