summaryrefslogtreecommitdiff
path: root/service/http/service_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-02-28 11:19:17 +0300
committerValery Piashchynski <[email protected]>2020-02-28 11:19:17 +0300
commit8240ea02181e80f8ac1347054e50718b4ba18ba0 (patch)
tree2feadfb93af68fc79edf1c4a18991c68e1a75462 /service/http/service_test.go
parent33f92daae1ecf9b9388cf3adb22a0efd2c3467d9 (diff)
Resolve test issues
Diffstat (limited to 'service/http/service_test.go')
-rw-r--r--service/http/service_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/service/http/service_test.go b/service/http/service_test.go
index 2bb4b905..968230a7 100644
--- a/service/http/service_test.go
+++ b/service/http/service_test.go
@@ -351,8 +351,7 @@ func Test_Service_Middleware(t *testing.T) {
t.Errorf("serve error: %v", err)
}
}()
- time.Sleep(time.Millisecond * 100)
- defer c.Stop()
+ time.Sleep(time.Second)
req, err := http.NewRequest("GET", "http://localhost:6032?hello=world", nil)
assert.NoError(t, err)
@@ -386,8 +385,10 @@ func Test_Service_Middleware(t *testing.T) {
err = r.Body.Close()
if err != nil {
+ c.Stop()
t.Errorf("error closing the Body: error %v", err)
}
+ c.Stop()
}
func Test_Service_Listener(t *testing.T) {