From 6c90bb87f160931a2e82bf3d7c7c2c0b0d64d3e0 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 19 Apr 2023 18:09:33 +0300 Subject: [PATCH] [#118] node: add ctx for unit tests for blobstor Signed-off-by: Airat Arifullin a.arifullin@yadro.com --- pkg/local_object_storage/blobstor/blobstor_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/local_object_storage/blobstor/blobstor_test.go b/pkg/local_object_storage/blobstor/blobstor_test.go index e1dae41fe4..ef85f0f1da 100644 --- a/pkg/local_object_storage/blobstor/blobstor_test.go +++ b/pkg/local_object_storage/blobstor/blobstor_test.go @@ -192,7 +192,7 @@ func TestConcurrentPut(t *testing.T) { require.NoError(t, blobStor.Init()) testGet := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) { - res, err := b.Get(common.GetPrm{Address: object.AddressOf(obj)}) + res, err := b.Get(context.Background(), common.GetPrm{Address: object.AddressOf(obj)}) require.NoError(t, err) require.Equal(t, obj, res.Object) } @@ -200,14 +200,14 @@ func TestConcurrentPut(t *testing.T) { testPut := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) { var prm common.PutPrm prm.Object = obj - _, err := b.Put(prm) + _, err := b.Put(context.Background(), prm) require.NoError(t, err) } testPutFileExistsError := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) { var prm common.PutPrm prm.Object = obj - if _, err := b.Put(prm); err != nil { + if _, err := b.Put(context.Background(), prm); err != nil { require.ErrorContains(t, err, "file exists") } } @@ -274,14 +274,14 @@ func TestConcurrentDelete(t *testing.T) { testPut := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) { var prm common.PutPrm prm.Object = obj - _, err := b.Put(prm) + _, err := b.Put(context.Background(), prm) require.NoError(t, err) } testDelete := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) { var prm common.DeletePrm prm.Address = object.AddressOf(obj) - if _, err := b.Delete(prm); err != nil { + if _, err := b.Delete(context.Background(), prm); err != nil { require.ErrorContains(t, err, "object not found") } } @@ -289,7 +289,7 @@ func TestConcurrentDelete(t *testing.T) { testDeletedExists := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) { var prm common.ExistsPrm prm.Address = object.AddressOf(obj) - res, err := b.Exists(prm) + res, err := b.Exists(context.Background(), prm) require.NoError(t, err) require.False(t, res.Exists) }