fix flaky fail to ban (#180)

This commit is contained in:
Boshi Lian 2023-08-01 16:45:13 -07:00 committed by GitHub
parent 066b6c22d4
commit e13f8e2a40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import (
"io"
"strings"
"testing"
"time"
)
func TestFailtoban(t *testing.T) {
@ -76,6 +77,8 @@ func TestFailtoban(t *testing.T) {
defer killCmd(c)
_ = c.Wait()
time.Sleep(time.Second) // TODO ugly workaround, wait for stdout flush
s, _ := io.ReadAll(stdout)
if !strings.Contains(string(s), "Connection closed by 127.0.0.1") {