forked from TrueCloudLab/frostfs-node
[#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:
parent
6eb0706b08
commit
e03d906cb7
4 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package meta_test
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package shard_test
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
|
|
Loading…
Reference in a new issue