Skip to content

Commit

Permalink
test: faster test
Browse files Browse the repository at this point in the history
  • Loading branch information
nugaon committed Dec 21, 2023
1 parent 9887792 commit ccb89ca
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/file/redundancy/getter/getter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ func TestGetterRACE(t *testing.T) {
}

var tcs []getterTest
for bufSize := 3; bufSize <= 128; bufSize += 21 {
for shardCnt := bufSize/2 + 1; shardCnt <= bufSize; shardCnt += 21 {
for bufSize := 3; bufSize <= 128; bufSize += 50 {
for shardCnt := bufSize/2 + 1; shardCnt <= bufSize; shardCnt += 50 {
parityCnt := bufSize - shardCnt
erasures := mrand.Perm(parityCnt - 1)
if len(erasures) > 3 {
erasures = erasures[:3]
if len(erasures) > 2 {
erasures = erasures[:2]
}
for _, erasureCnt := range erasures {
tcs = append(tcs, getterTest{bufSize, shardCnt, erasureCnt})
}
tcs = append(tcs, getterTest{bufSize, shardCnt, parityCnt}, getterTest{bufSize, shardCnt, parityCnt + 1})
erasures = mrand.Perm(shardCnt - 1)
if len(erasures) > 3 {
erasures = erasures[:3]
if len(erasures) > 2 {
erasures = erasures[:2]
}
for _, erasureCnt := range erasures {
tcs = append(tcs, getterTest{bufSize, shardCnt, erasureCnt + parityCnt + 1})
Expand Down Expand Up @@ -156,7 +156,7 @@ func testDecodingFallback(t *testing.T, s getter.Strategy, strict bool) {

bufSize := 12
shardCnt := 6
store := mockstorer.NewDelayedStore(inmem.New())
store := mockstorer.NewDelayedStore(inmem.New())
buf := make([][]byte, bufSize)
addrs := initData(t, buf, shardCnt, store)

Expand Down

0 comments on commit ccb89ca

Please sign in to comment.