mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
Do not shadown err within MSSQL test container intialization (#28468)
- Get better test failure error messages by not shadowing the errors when we are attempting to start the MSSQL docker container, so we can fail the tests with the proper error message that is occuring instead of mssqlhelper.go:60: Could not start docker MSSQL: %!s(<nil>)
This commit is contained in:
@@ -35,7 +35,8 @@ func PrepareMSSQLTestContainer(t *testing.T) (cleanup func(), retURL string) {
|
||||
var err error
|
||||
for i := 0; i < numRetries; i++ {
|
||||
var svc *docker.Service
|
||||
runner, err := docker.NewServiceRunner(docker.RunOptions{
|
||||
var runner *docker.Runner
|
||||
runner, err = docker.NewServiceRunner(docker.RunOptions{
|
||||
ContainerName: "sqlserver",
|
||||
ImageRepo: "mcr.microsoft.com/mssql/server",
|
||||
ImageTag: "2017-latest-ubuntu",
|
||||
@@ -48,7 +49,8 @@ func PrepareMSSQLTestContainer(t *testing.T) (cleanup func(), retURL string) {
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Could not start docker MSSQL: %s", err)
|
||||
t.Logf("Could not start docker MSSQL: %v", err)
|
||||
continue
|
||||
}
|
||||
|
||||
svc, err = runner.StartService(context.Background(), connectMSSQL)
|
||||
@@ -57,7 +59,7 @@ func PrepareMSSQLTestContainer(t *testing.T) (cleanup func(), retURL string) {
|
||||
}
|
||||
}
|
||||
|
||||
t.Fatalf("Could not start docker MSSQL: %s", err)
|
||||
t.Fatalf("Could not start docker MSSQL: %v", err)
|
||||
return nil, ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user