From 52ff237ce83ab5905300b581edb1e9ec66baa60d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 4 Dec 2024 20:35:13 +0300 Subject: [PATCH] TEST Signed-off-by: Leonard Lyubich --- pool/pool_aio_test.go | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/pool/pool_aio_test.go b/pool/pool_aio_test.go index 341f42f3..d99c0cc8 100644 --- a/pool/pool_aio_test.go +++ b/pool/pool_aio_test.go @@ -246,7 +246,6 @@ func testPoolInterfaceWithAIO(t *testing.T, nodeAddr string) { ctx := context.Background() account, signer, cont := testData(t) - var eaclTable eacl.Table poolStat := stat.NewPoolStatistic() opts := DefaultOptions() @@ -258,8 +257,6 @@ func testPoolInterfaceWithAIO(t *testing.T, nodeAddr string) { require.NoError(t, err) require.NoError(t, pool.Dial(ctx)) - var containerID cid.ID - var objectID oid.ID var objectList []oid.ID payload := make([]byte, 8) @@ -303,36 +300,32 @@ func testPoolInterfaceWithAIO(t *testing.T, nodeAddr string) { require.Greater(t, snap.AllTime(), uint64(0)) }) - t.Run("create container", func(t *testing.T) { - ctxTimeout, cancel := context.WithTimeout(context.Background(), defaultTimeOut) - defer cancel() - - containerID = testCreateContainer(ctxTimeout, t, signer, cont, pool) - cl, err := pool.sdkClient() + // create container + ctxTimeout, cancel := context.WithTimeout(context.Background(), defaultTimeOut) + defer cancel() - require.NoError(t, err) - require.NoError(t, isBucketCreated(ctxTimeout, cl, containerID)) + containerID := testCreateContainer(ctxTimeout, t, signer, cont, pool) + cl, err := pool.sdkClient() - eaclTable = testEaclTable(containerID) - }) + require.NoError(t, err) + require.NoError(t, isBucketCreated(ctxTimeout, cl, containerID)) t.Run("set eacl", func(t *testing.T) { ctxTimeout, cancel := context.WithTimeout(ctx, defaultTimeOut) defer cancel() - table := testSetEacl(ctxTimeout, t, signer, eaclTable, pool) + table := testSetEacl(ctxTimeout, t, signer, testEaclTable(containerID), pool) cl, err := pool.sdkClient() require.NoError(t, err) require.NoError(t, isEACLCreated(ctxTimeout, cl, containerID, table)) }) - t.Run("upload object", func(t *testing.T) { - ctxTimeout, cancel := context.WithTimeout(ctx, defaultTimeOut) - defer cancel() + // upload object + ctxTimeout, cancel = context.WithTimeout(ctx, defaultTimeOut) + defer cancel() - objectID = testObjectPutInit(ctxTimeout, t, account, containerID, signer, payload, pool) - }) + objectID := testObjectPutInit(ctxTimeout, t, account, containerID, signer, payload, pool) t.Run("download object", func(t *testing.T) { ctxTimeout, cancel := context.WithTimeout(ctx, defaultTimeOut)