summaryrefslogtreecommitdiff
path: root/service/http/h2c_test.go
diff options
context:
space:
mode:
authorParamtamtam <[email protected]>2019-12-24 10:48:49 +0500
committerGitHub <[email protected]>2019-12-24 10:48:49 +0500
commitfbd2022729ab7ffe4eee8ba8b7357ba179e4d010 (patch)
treefa6b66b18259282b2efe00a41c445a3fa40aa701 /service/http/h2c_test.go
parent3f7d8bc007a4efdd48bb16253c2686006f0f9cda (diff)
parent75a817edcff22e721dcc3a7fa5590b866f630403 (diff)
Merge branch 'master' into master
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)