diff options
author | Valery Piashchynski <[email protected]> | 2020-02-28 01:25:07 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-02-28 01:25:07 +0300 |
commit | 75e0092d8aab6033a002ad54bf667be71f45fecf (patch) | |
tree | a17a94796cb9b6772fb967de4c42a50c0f51eb92 /service | |
parent | 967d9959602537492adcd2f7216017fda5cc8308 (diff) |
Test_RPC_Unix update
Diffstat (limited to 'service')
-rw-r--r-- | service/http/rpc_test.go | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/service/http/rpc_test.go b/service/http/rpc_test.go index 0e4b2c0a..f7be3c70 100644 --- a/service/http/rpc_test.go +++ b/service/http/rpc_test.go @@ -124,17 +124,29 @@ func Test_RPC_Unix(t *testing.T) { time.Sleep(time.Millisecond * 100) defer c.Stop() - res, _, _ := get("http://localhost:6029") - assert.Equal(t, strconv.Itoa(*ss.rr.Workers()[0].Pid), res) + res, _, err := get("http://localhost:6029") + if err != nil { + t.Fatal(err) + } + if ss.rr.Workers() != nil && len(ss.rr.Workers()) > 0 { + assert.Equal(t, strconv.Itoa(*ss.rr.Workers()[0].Pid), res) + } else { + t.Fatal("no workers initialized") + } cl, err := rs.Client() - assert.NoError(t, err) + if err != nil { + t.Fatal(err) + } r := "" 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(err) + } assert.Equal(t, strconv.Itoa(*ss.rr.Workers()[0].Pid), res2) assert.NotEqual(t, res, res2) } |