Commit faaef839 authored by Alexander Morozov's avatar Alexander Morozov

Use less strict condition to avoid problems with concurrency

In latest go versions TestWatcher fails pretty often, because it is
"more concurrent" now. Reproducible with go master:
while go test github.com/mholt/caddy/middleware/markdown; do :; done
Signed-off-by: default avatarAlexander Morozov <lk4d4@docker.com>
parent 287543a0
...@@ -17,10 +17,11 @@ func TestWatcher(t *testing.T) { ...@@ -17,10 +17,11 @@ func TestWatcher(t *testing.T) {
i++ i++
out += fmt.Sprint(i) out += fmt.Sprint(i)
}) })
time.Sleep(interval * 8) // wait little more because of concurrency
time.Sleep(interval * 9)
stopChan <- struct{}{} stopChan <- struct{}{}
if expected != out { if !strings.HasPrefix(out, expected) {
t.Fatalf("Expected %v, found %v", expected, out) t.Fatalf("Expected to have prefix %v, found %v", expected, out)
} }
out = "" out = ""
i = 0 i = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment