[#920] tests: Fix data races

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-01-18 22:24:34 +03:00
parent e42262a863
commit f5160b27fc
3 changed files with 37 additions and 0 deletions

View file

@ -20,6 +20,9 @@ func TestRebalance(t *testing.T) {
t.Parallel()
te := newEngineWithErrorThreshold(t, "", 0)
defer func() {
require.NoError(t, te.ng.Close(context.Background()))
}()
const (
objCount = 20
@ -106,6 +109,9 @@ func TestRebalanceSingleThread(t *testing.T) {
t.Parallel()
te := newEngineWithErrorThreshold(t, "", 0)
defer func() {
require.NoError(t, te.ng.Close(context.Background()))
}()
obj := testutil.GenerateObjectWithCID(cidtest.ID())
obj.SetPayload(make([]byte, errSmallSize))
@ -153,6 +159,9 @@ type deleteEvent struct {
func TestRebalanceExitByContext(t *testing.T) {
te := newEngineWithErrorThreshold(t, "", 0)
defer func() {
require.NoError(t, te.ng.Close(context.Background()))
}()
objects := make([]*objectSDK.Object, 4)
for i := range objects {