summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-24 16:44:19 +0300
committerValery Piashchynski <[email protected]>2020-11-24 16:44:19 +0300
commit30825ef9b4a742f8e7bf7b8caee0bedccb36b601 (patch)
tree68ec653117d84d4c5c906505de73292d0ad2b817
parent12bcbc309c5f3432d860f7aa106033d1ddf9e824 (diff)
force Test_StaticPool_Broken_Replace to finish
-rw-r--r--plugins/http/tests/http_test.go4
-rwxr-xr-xstatic_pool_test.go12
2 files changed, 15 insertions, 1 deletions
diff --git a/plugins/http/tests/http_test.go b/plugins/http/tests/http_test.go
index 117bccb7..ca79e94e 100644
--- a/plugins/http/tests/http_test.go
+++ b/plugins/http/tests/http_test.go
@@ -422,6 +422,9 @@ func TestFastCGI_RequestUri(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
+
+ t.Run("FastCGIServiceRequestUri", fcgiReqURI)
+
go func() {
tt := time.NewTimer(time.Second * 10)
defer wg.Done()
@@ -450,7 +453,6 @@ func TestFastCGI_RequestUri(t *testing.T) {
}
}()
- t.Run("FastCGIServiceRequestUri", fcgiReqURI)
wg.Wait()
}
diff --git a/static_pool_test.go b/static_pool_test.go
index f8478e14..cbbae07a 100755
--- a/static_pool_test.go
+++ b/static_pool_test.go
@@ -174,7 +174,18 @@ 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()
+ wg.Done()
+ }
+ }()
+
time.Sleep(time.Second)
+
workers := p.Workers()
for i := 0; i < len(workers); i++ {
workers[i].AddListener(func(event interface{}) {
@@ -194,6 +205,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) {
assert.Nil(t, res.Body)
wg.Wait()
+ tt.Stop()
p.Destroy(ctx)
}