test: try to clear connection refused more aggressively

Try to stabilize some tests.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
This commit is contained in:
Andrey Smirnov 2025-09-18 14:11:37 +04:00
parent 51db5279c4
commit 53ce93aaed
No known key found for this signature in database
GPG Key ID: 322C6F63F594CE7C
2 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,7 @@ package api
import (
"context"
"encoding/json"
"fmt"
"net/url"
"os"
"testing"
@ -118,7 +119,9 @@ func (suite *ApplyConfigSuite) TestApply() {
Mode: machineapi.ApplyConfigurationRequest_REBOOT,
},
)
suite.Assert().NoErrorf(err, "failed to apply configuration (node %q)", node)
if err != nil {
return fmt.Errorf("failed to apply configuration (node %q): %w", node, err)
}
return nil
}, assertRebootedRebootTimeout,

View File

@ -398,7 +398,7 @@ func (apiSuite *APISuite) ClearConnectionRefused(ctx context.Context, nodes ...s
}
apiSuite.Require().NoError(retry.Constant(backoff.DefaultConfig.MaxDelay, retry.WithUnits(time.Second)).Retry(func() error {
for range numMasterNodes {
for range numMasterNodes * 5 {
_, err := apiSuite.Client.Version(client.WithNodes(ctx, nodes...))
if err == nil {
continue