summaryrefslogtreecommitdiff
path: root/service/http/h2c_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2019-11-17 18:13:15 +0300
committerValery Piashchynski <[email protected]>2019-11-17 18:13:15 +0300
commita7982f6e692e9dc40f035d5f1486cb2bbae71f88 (patch)
treeab4b32c190bc8bffd9b1b99b806e03192729c59a /service/http/h2c_test.go
parentc463235f55cdae5fa7c63a87e7cc73c6e535d27a (diff)
finish the check
Diffstat (limited to 'service/http/h2c_test.go')
-rw-r--r--service/http/h2c_test.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/service/http/h2c_test.go b/service/http/h2c_test.go
index d806e5ff..7bbc30ac 100644
--- a/service/http/h2c_test.go
+++ b/service/http/h2c_test.go
@@ -36,7 +36,12 @@ func Test_Service_H2C(t *testing.T) {
// should do nothing
s.(*Service).Stop()
- go func() { c.Serve() }()
+ go func() {
+ err := c.Serve()
+ if err != nil {
+ t.Errorf("error serving: %v", err)
+ }
+ }()
time.Sleep(time.Millisecond * 100)
defer c.Stop()
@@ -49,7 +54,12 @@ func Test_Service_H2C(t *testing.T) {
r, err := http.DefaultClient.Do(req)
assert.NoError(t, err)
- defer r.Body.Close()
+ defer func() {
+ err := r.Body.Close()
+ if err != nil {
+ t.Errorf("fail to close the Body: error %v", err)
+ }
+ }()
assert.Equal(t, "101 Switching Protocols", r.Status)