summaryrefslogtreecommitdiff
path: root/static_pool_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-26 15:30:16 +0300
committerGitHub <[email protected]>2020-11-26 15:30:16 +0300
commitee68279e68ab854ae313fc84ea6a2a905133da87 (patch)
treef0731b1bbbc996347060e8c88d49616090877a65 /static_pool_test.go
parent0a48a027642a34c560717526c55f70b7260d678c (diff)
parent7ef7ce5859be3b30476167ee9a2d9d3b0092259a (diff)
Merge pull request #400 from spiral/plugin/http
[RR2] New http plugin for the RR 2.0
Diffstat (limited to 'static_pool_test.go')
-rwxr-xr-xstatic_pool_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/static_pool_test.go b/static_pool_test.go
index 27907af5..e97e2034 100755
--- a/static_pool_test.go
+++ b/static_pool_test.go
@@ -174,6 +174,19 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
+ // force test to finish
+ tt := time.NewTimer(time.Second * 20)
+ go func() {
+ select {
+ case <-tt.C:
+ tt.Stop()
+ assert.Fail(t, "force exit from the test")
+ wg.Done()
+ }
+ }()
+
+ time.Sleep(time.Second)
+
workers := p.Workers()
for i := 0; i < len(workers); i++ {
workers[i].AddListener(func(event interface{}) {
@@ -193,6 +206,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
assert.Nil(t, res.Body)
wg.Wait()
+ tt.Stop()
p.Destroy(ctx)
}