mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-27 23:03:37 -05:00
Merge pull request #241 from LK4D4/fix_race_test
markdown: Use less strict condition to avoid problems with concurrency
This commit is contained in:
commit
f4054b6954
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue