[#236] testutil: Use random object id in RandObjGenerator
Before this commit it was like this: ``` BenchmarkSubstorageWritePerf/memstore-rand10-8 227425 4859 ns/op BenchmarkSubstorageWritePerf/fstree_nosync-rand10-8 --- FAIL: BenchmarkSubstorageWritePerf/fstree_nosync-rand10-8 perf_test.go:165: writing entry: file exists perf_test.go:165: writing entry: file exists perf_test.go:165: writing entry: file exists BenchmarkSubstorageWritePerf/fstree-rand10-8 --- FAIL: BenchmarkSubstorageWritePerf/fstree-rand10-8 perf_test.go:165: writing entry: file exists perf_test.go:165: writing entry: file exists perf_test.go:165: writing entry: file exists ``` Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
c85a0bc866
commit
6ad5c38225
1 changed files with 3 additions and 1 deletions
|
@ -81,7 +81,9 @@ type RandObjGenerator struct {
|
|||
var _ ObjectGenerator = &RandObjGenerator{}
|
||||
|
||||
func (g *RandObjGenerator) Next() *object.Object {
|
||||
return generateObjectWithOIDWithCIDWithSize(oid.ID{}, cid.ID{}, g.ObjSize)
|
||||
var id oid.ID
|
||||
rand.Read(id[:])
|
||||
return generateObjectWithOIDWithCIDWithSize(id, cid.ID{}, g.ObjSize)
|
||||
}
|
||||
|
||||
// OverwriteObjGenerator is an ObjectGenerator that generates entries with random payloads of size objSize and at most maxObjects distinct IDs.
|
||||
|
|
Loading…
Reference in a new issue