pilorama: Speedup TestForest_ApplyRandom() #615
1 changed files with 4 additions and 4 deletions
|
@ -825,7 +825,7 @@ func testForestTreeParallelApply(t *testing.T, constructor func(t testing.TB, _
|
||||||
cid := cidtest.ID()
|
cid := cidtest.ID()
|
||||||
treeID := "version"
|
treeID := "version"
|
||||||
|
|
||||||
expected := constructor(t)
|
expected := constructor(t, WithNoSync(true))
|
||||||
for i := range ops {
|
for i := range ops {
|
||||||
require.NoError(t, expected.TreeApply(context.Background(), cid, treeID, &ops[i], false))
|
require.NoError(t, expected.TreeApply(context.Background(), cid, treeID, &ops[i], false))
|
||||||
}
|
}
|
||||||
|
@ -834,7 +834,7 @@ func testForestTreeParallelApply(t *testing.T, constructor func(t testing.TB, _
|
||||||
// Shuffle random operations, leave initialization in place.
|
// Shuffle random operations, leave initialization in place.
|
||||||
r.Shuffle(len(ops), func(i, j int) { ops[i], ops[j] = ops[j], ops[i] })
|
r.Shuffle(len(ops), func(i, j int) { ops[i], ops[j] = ops[j], ops[i] })
|
||||||
|
|
||||||
actual := constructor(t, WithMaxBatchSize(batchSize))
|
actual := constructor(t, WithMaxBatchSize(batchSize), WithNoSync(true))
|
||||||
wg := new(sync.WaitGroup)
|
wg := new(sync.WaitGroup)
|
||||||
ch := make(chan *Move)
|
ch := make(chan *Move)
|
||||||
for i := 0; i < batchSize; i++ {
|
for i := 0; i < batchSize; i++ {
|
||||||
|
@ -870,7 +870,7 @@ func testForestTreeApplyRandom(t *testing.T, constructor func(t testing.TB, _ ..
|
||||||
cid := cidtest.ID()
|
cid := cidtest.ID()
|
||||||
treeID := "version"
|
treeID := "version"
|
||||||
|
|
||||||
expected := constructor(t)
|
expected := constructor(t, WithNoSync(true))
|
||||||
for i := range ops {
|
for i := range ops {
|
||||||
require.NoError(t, expected.TreeApply(context.Background(), cid, treeID, &ops[i], false))
|
require.NoError(t, expected.TreeApply(context.Background(), cid, treeID, &ops[i], false))
|
||||||
}
|
}
|
||||||
|
@ -880,7 +880,7 @@ func testForestTreeApplyRandom(t *testing.T, constructor func(t testing.TB, _ ..
|
||||||
// Shuffle random operations, leave initialization in place.
|
// Shuffle random operations, leave initialization in place.
|
||||||
r.Shuffle(len(ops), func(i, j int) { ops[i], ops[j] = ops[j], ops[i] })
|
r.Shuffle(len(ops), func(i, j int) { ops[i], ops[j] = ops[j], ops[i] })
|
||||||
|
|
||||||
actual := constructor(t)
|
actual := constructor(t, WithNoSync(true))
|
||||||
for i := range ops {
|
for i := range ops {
|
||||||
require.NoError(t, actual.TreeApply(context.Background(), cid, treeID, &ops[i], false))
|
require.NoError(t, actual.TreeApply(context.Background(), cid, treeID, &ops[i], false))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue