summaryrefslogtreecommitdiff
path: root/plugins/static
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-01 16:59:06 +0300
committerValery Piashchynski <[email protected]>2020-12-01 16:59:06 +0300
commit84c8234ec01ad1d5ea5f0a8c7dbca9a3012bcb2b (patch)
treed70f1d5fb0f36821825d0805d71f22940ec6a1af /plugins/static
parent2ac6d3192fbd43f0911d7c87f394fd0839b0fcfa (diff)
parent70910821a0ffb10316f9970a2fec4c3379d10675 (diff)
Merge branch 'release_2.0' into plugin/headers
# Conflicts: # static_pool_test.go
Diffstat (limited to 'plugins/static')
-rw-r--r--plugins/static/tests/static_plugin_test.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/static/tests/static_plugin_test.go b/plugins/static/tests/static_plugin_test.go
index a9cb1fd1..d0403160 100644
--- a/plugins/static/tests/static_plugin_test.go
+++ b/plugins/static/tests/static_plugin_test.go
@@ -57,8 +57,9 @@ func TestStaticPlugin(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
+ tt := time.NewTimer(time.Second * 10)
+
go func() {
- tt := time.NewTimer(time.Second * 10)
defer wg.Done()
for {
select {
@@ -85,6 +86,7 @@ func TestStaticPlugin(t *testing.T) {
}
}()
+ time.Sleep(time.Second)
t.Run("ServeSample", serveStaticSample)
t.Run("StaticNotForbid", staticNotForbid)
t.Run("StaticHeaders", staticHeaders)
@@ -163,8 +165,9 @@ func TestStaticDisabled(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
+ tt := time.NewTimer(time.Second * 10)
+
go func() {
- tt := time.NewTimer(time.Second * 10)
defer wg.Done()
for {
select {
@@ -191,6 +194,7 @@ func TestStaticDisabled(t *testing.T) {
}
}()
+ time.Sleep(time.Second)
t.Run("StaticDisabled", staticDisabled)
wg.Wait()
}
@@ -234,8 +238,9 @@ func TestStaticFilesDisabled(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
+ tt := time.NewTimer(time.Second * 10)
+
go func() {
- tt := time.NewTimer(time.Second * 10)
defer wg.Done()
for {
select {
@@ -262,6 +267,7 @@ func TestStaticFilesDisabled(t *testing.T) {
}
}()
+ time.Sleep(time.Second)
t.Run("StaticFilesDisabled", staticFilesDisabled)
wg.Wait()
}
@@ -314,8 +320,9 @@ func TestStaticFilesForbid(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
+ tt := time.NewTimer(time.Second * 10)
+
go func() {
- tt := time.NewTimer(time.Second * 10)
defer wg.Done()
for {
select {
@@ -342,6 +349,7 @@ func TestStaticFilesForbid(t *testing.T) {
}
}()
+ time.Sleep(time.Second)
t.Run("StaticTestFilesDir", staticTestFilesDir)
t.Run("StaticNotFound", staticNotFound)
t.Run("StaticFilesForbid", staticFilesForbid)