[#2] Change timeouts for integration tests

Signed-off-by: Aleksey Kravchenko <al.kravchenko@yadro.com>
This commit is contained in:
Aleksey Kravchenko 2025-01-10 12:20:36 +03:00
parent 36b2093087
commit 14e1e5d39d

View file

@ -15,6 +15,7 @@ import (
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
dcontainer "github.com/docker/docker/api/types/container"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/wallet"
"github.com/restic/restic/internal/backend"
@ -26,7 +27,10 @@ import (
func TestIntegration(t *testing.T) {
filename := createWallet(t)
defer os.Remove(filename)
defer func() {
err := os.Remove(filename)
require.NoError(t, err)
}()
rootCtx := context.Background()
aioImage := "truecloudlab/frostfs-aio:"
@ -60,11 +64,11 @@ func TestIntegration(t *testing.T) {
_, err = createContainer(ctx, p, owner, cfg.Container, "REP 1")
require.NoError(t, err)
backend, err := Open(ctx, cfg, nil)
fsBackend, err := Open(ctx, cfg, nil)
require.NoError(t, err)
t.Run("simple store load delete "+version, func(t *testing.T) { simpleStoreLoadDelete(ctx, t, backend) })
t.Run("list "+version, func(t *testing.T) { simpleList(ctx, t, backend) })
t.Run("simple store load delete "+version, func(t *testing.T) { simpleStoreLoadDelete(ctx, t, fsBackend) })
t.Run("list "+version, func(t *testing.T) { simpleList(ctx, t, fsBackend) })
err = aioContainer.Terminate(ctx)
require.NoError(t, err)
@ -135,7 +139,7 @@ func createContainer(ctx context.Context, client *pool.Pool, owner user.ID, cont
wp := &pool.WaitParams{
PollInterval: 5 * time.Second,
Timeout: 30 * time.Second,
Timeout: 2 * time.Minute,
}
prm := pool.PrmContainerPut{
ClientParams: sdkClient.PrmContainerPut{
@ -178,11 +182,13 @@ func createWallet(t *testing.T) string {
func createDockerContainer(ctx context.Context, t *testing.T, image string) testcontainers.Container {
req := testcontainers.ContainerRequest{
Image: image,
WaitingFor: wait.NewLogStrategy("aio container started").WithStartupTimeout(30 * time.Second),
Name: "aio",
Hostname: "aio",
NetworkMode: "host",
Image: image,
WaitingFor: wait.NewLogStrategy("aio container started").WithStartupTimeout(time.Minute),
Name: "aio",
Hostname: "aio",
HostConfigModifier: func(hc *dcontainer.HostConfig) {
hc.NetworkMode = "host"
},
}
aioC, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
ContainerRequest: req,