summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-11 15:01:04 +0300
committerWolfy-J <[email protected]>2018-06-11 15:01:04 +0300
commit699d34beb94492d57a8da15cfbaebe11245ecac9 (patch)
tree6d41c01e09216fa82a9008f06cc3d79140ea8052
parent846cec64f177a9cfef016a8225c4fae0faa29a0c (diff)
improved tests
-rw-r--r--service/container_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/service/container_test.go b/service/container_test.go
index 1fcff8db..8eaf13d4 100644
--- a/service/container_test.go
+++ b/service/container_test.go
@@ -46,6 +46,10 @@ func (t *testService) Serve() error {
<-t.serving
+ t.mu.Lock()
+ t.serving = nil
+ t.mu.Unlock()
+
return nil
}
@@ -53,7 +57,12 @@ func (t *testService) Stop() {
t.mu.Lock()
defer t.mu.Unlock()
+ if t.serving == nil {
+ return
+ }
+
close(t.serving)
+ t.serving = nil
}
func (t *testService) waitChan() chan interface{} {