From e13f8e2a4024f8e8bae6b5e654b04dca147039d1 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Tue, 1 Aug 2023 16:45:13 -0700 Subject: [PATCH] fix flaky fail to ban (#180) --- e2e/failtoban_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/e2e/failtoban_test.go b/e2e/failtoban_test.go index a1dcdc8c4..412b1b38d 100644 --- a/e2e/failtoban_test.go +++ b/e2e/failtoban_test.go @@ -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") {