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