test(general): Increase timeout to check for generated TLS cert (#3696)

* add debug messages

* increase wait time for tls cert

* add error messages for easier debugging

* Update tests/tools/kopiarunner/kopia_snapshotter.go

Co-authored-by: Nick <nick@kasten.io>

* add comment

---------

Co-authored-by: Nick <nick@kasten.io>
This commit is contained in:
chaitalisgandNick authored and GitHub committed 2024-03-05 22:54:39 +00:00
1 parent 44f5767fb1
commit c07fb8b14f
2 files changed
+8 -4

No files matched your search

+5 -2
View File
@@ -28,7 +28,7 @@ const (
noCheckForUpdatesFlag = "--no-check-for-updates"
noProgressFlag = "--no-progress"
parallelFlag = "--parallel"
retryCount = 180
retryCount = 900
retryInterval = 1 * time.Second
waitingForServerString = "waiting for server to start"
serverControlPassword = "abcdef"
@@ -395,11 +395,14 @@ func (ks *KopiaSnapshotter) ConnectOrCreateRepoWithServer(serverAddr string, arg
var cmdErr error
if cmd, cmdErr = ks.CreateServer(serverAddr, serverArgs...); cmdErr != nil {
return nil, "", cmdErr
return nil, "", errors.Wrap(cmdErr, "CreateServer failed")
}
if err := certKeyExist(context.TODO(), tlsCertFile, tlsKeyFile); err != nil {
if buf, ok := cmd.Stderr.(*bytes.Buffer); ok {
// If the STDERR buffer does not contain any obvious error output,
// it is possible the async server creation above is taking a long time
// to open the repository, and we timed out waiting for it to write the TLS certs.
log.Print("failure in certificate generation:", buf.String())
}
+3 -2
View File
@@ -3,12 +3,13 @@ package kopiarunner
import (
"bytes"
"errors"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
"github.com/pkg/errors"
)
const (
@@ -88,7 +89,7 @@ func (kr *Runner) RunAsync(args ...string) (*exec.Cmd, error) {
err := c.Start()
if err != nil {
return nil, err
return nil, errors.Wrap(err, "Run async failed for "+kr.Exe)
}
return c, nil