test: Add require.Eventually to TestBridge_UserAgentFromSMTPClient

This commit is contained in:
Leander Beernaert
2023-07-06 14:40:17 +02:00
parent 0afdc31f96
commit 0d57e3645a

View File

@ -25,6 +25,7 @@ import (
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
"strings"
"sync" "sync"
"testing" "testing"
"time" "time"
@ -300,8 +301,11 @@ func TestBridge_UserAgentFromSMTPClient(t *testing.T) {
string(info.BridgePass)), string(info.BridgePass)),
)) ))
currentUserAgent = b.GetCurrentUserAgent() require.Eventually(t, func() bool {
require.Contains(t, currentUserAgent, "UnknownClient/0.0.1") currentUserAgent = b.GetCurrentUserAgent()
return strings.Contains(currentUserAgent, "UnknownClient/0.0.1")
}, time.Minute, 5*time.Second)
}) })
}) })
} }