Increase timeout for DialAndSend context

Updated the timeout for the DialAndSend context in 'client_test.go' from 5 seconds to 1 minute to ensure sufficient time for the operation to complete. This change helps prevent premature timeouts that can cause test failures.
This commit is contained in:
Winni Neessen 2024-11-21 10:33:24 +01:00
parent 1a579c2149
commit 6e9df0b724
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -2327,7 +2327,7 @@ func TestClient_DialAndSendWithContext(t *testing.T) {
msg := testMessage(t) msg := testMessage(t)
msg.SetMessageIDWithValue("this.is.a.message.id") msg.SetMessageIDWithValue("this.is.a.message.id")
ctxDial, cancelDial := context.WithTimeout(ctx, time.Second*5) ctxDial, cancelDial := context.WithTimeout(ctx, time.Minute)
defer cancelDial() defer cancelDial()
if goroutineErr := client.DialAndSendWithContext(ctxDial, msg); goroutineErr != nil { if goroutineErr := client.DialAndSendWithContext(ctxDial, msg); goroutineErr != nil {
t.Errorf("failed to dial and send message: %s", goroutineErr) t.Errorf("failed to dial and send message: %s", goroutineErr)