[#334] engine: Make tests more predictable

There is a codecov issue because objects are not placed
in the engine the same way every unit test. Therefore
sometimes there are more coverage, sometimes there are
less. Seeded RNG should solve this issue for engine tests.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-01-20 21:13:18 +03:00 committed by Alex Vanin
parent 6eb0706b08
commit e03d906cb7
4 changed files with 8 additions and 4 deletions

View file

@ -1,8 +1,8 @@
package blobovnicza
import (
"crypto/rand"
"crypto/sha256"
"math/rand"
"os"
"testing"
@ -70,6 +70,8 @@ func testGet(t *testing.T, blz *Blobovnicza, addr *objectSDK.Address, expObj []b
}
func TestBlobovnicza(t *testing.T) {
rand.Seed(1024)
p := "./test_blz"
sizeLim := uint64(256 * 1 << 10) // 256KB

View file

@ -1,9 +1,9 @@
package blobstor
import (
"crypto/rand"
"crypto/sha256"
"errors"
"math/rand"
"os"
"testing"
@ -55,6 +55,8 @@ func testObject(sz uint64) *object.Object {
}
func TestBlobovniczas(t *testing.T) {
rand.Seed(1024)
l := test.NewLogger(false)
p := "./test_blz"

View file

@ -1,8 +1,8 @@
package meta_test
import (
"crypto/rand"
"crypto/sha256"
"math/rand"
"os"
"testing"

View file

@ -1,8 +1,8 @@
package shard_test
import (
"crypto/rand"
"crypto/sha256"
"math/rand"
"os"
"path"
"testing"