Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Fix upgrade test by cleanly stopping test containers
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesGuthrie committed Aug 31, 2022
1 parent 70f7365 commit d486d58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/internal/testhelpers/containers.go
Expand Up @@ -12,6 +12,7 @@ import (
"io/ioutil"
"os"
"runtime"
"time"

"github.com/testcontainers/testcontainers-go"
)
Expand Down Expand Up @@ -93,8 +94,8 @@ func StopContainer(ctx context.Context, container testcontainers.Container, prin
fmt.Fprintln(os.Stderr, "couldn't stop log producer", err)
}
}

err := container.Terminate(ctx)
timeout := 10 * time.Second
err := container.Stop(ctx, &timeout)
if err != nil {
fmt.Fprintln(os.Stderr, "couldn't terminate container", err)
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/tests/upgrade_tests/upgrade_test.go
Expand Up @@ -87,6 +87,11 @@ func getDBImages(extensionState testhelpers.TestOptions, prevPromscaleVersion *s
panic("Only use pg12 for upgrade tests")
}

// From Promscale 0.14.0 onwards the minimum extension version is 0.6.0
if prevPromscaleVersion != nil && prevPromscaleVersion.GE(semver.MustParse("0.14.0")) {
return "timescale/timescaledb-ha:pg" + pgVersion + ".12-ts2.7.2-latest", dockerImageName, nil
}

// From Promscale 0.13.0 onwards the minimum extension version is 0.5.4
if prevPromscaleVersion != nil && prevPromscaleVersion.GE(semver.MustParse("0.13.0")) {
return "timescale/timescaledb-ha:pg" + pgVersion + ".11-ts2.7.1-latest", dockerImageName, nil
Expand Down

0 comments on commit d486d58

Please sign in to comment.