[#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>
remotes/KirillovDenis/release/v0.21.1
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"