Skip to content

Commit

Permalink
lower max size for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Jul 2, 2024
1 parent 60427d9 commit 19d8d47
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
4 changes: 2 additions & 2 deletions share/new_eds/proofs_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
)

func TestCache(t *testing.T) {
ODSSize := 64
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
ODSSize := 16
ctx, cancel := context.WithTimeout(context.Background(), time.Second*15)
t.Cleanup(cancel)

newAccessor := func(tb testing.TB, inner *rsmt2d.ExtendedDataSquare) Accessor {
Expand Down
10 changes: 0 additions & 10 deletions share/new_eds/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package eds

import (
"errors"
"fmt"
"io"
"math/rand"
"testing"
Expand All @@ -13,19 +12,11 @@ import (
"github.com/celestiaorg/celestia-node/share/eds/edstest"
)

func TestSharesReaderMany(t *testing.T) {
// create io.Writer that write random data
for i := 0; i < 10000; i++ {
TestSharesReader(t)
}
}

func TestSharesReader(t *testing.T) {
// create io.Writer that write random data
odsSize := 16
eds := edstest.RandEDS(t, odsSize)
getShare := func(rowIdx, colIdx int) ([]byte, error) {
fmt.Println("get", rowIdx, colIdx)
return eds.GetCell(uint(rowIdx), uint(colIdx)), nil
}

Expand Down Expand Up @@ -56,7 +47,6 @@ func readWithRandomBuffer(reader io.Reader, maxBufSize int) ([]byte, error) {
}
data = append(data, buf...)
if errors.Is(err, io.EOF) {
fmt.Println("eof?")
break
}
}
Expand Down
4 changes: 2 additions & 2 deletions share/new_eds/rsmt2d_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
)

func TestRsmt2dAccessor(t *testing.T) {
odsSize := 64
odsSize := 16
newAccessor := func(tb testing.TB, eds *rsmt2d.ExtendedDataSquare) Accessor {
return &Rsmt2D{ExtendedDataSquare: eds}
}
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*15)
t.Cleanup(cancel)

TestSuiteAccessor(ctx, t, newAccessor, odsSize)
Expand Down
4 changes: 2 additions & 2 deletions store/file/ods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ func TestReadODSFromFile(t *testing.T) {
}

func TestODSFile(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
t.Cleanup(cancel)

ODSSize := 64
ODSSize := 16
eds.TestSuiteAccessor(ctx, t, createAccessor, ODSSize)
eds.TestStreamer(ctx, t, createCachedStreamer, ODSSize)
eds.TestStreamer(ctx, t, createStreamer, ODSSize)
Expand Down
4 changes: 2 additions & 2 deletions store/file/q1q4_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ func TestCreateQ1Q4File(t *testing.T) {
}

func TestQ1Q4File(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
t.Cleanup(cancel)

ODSSize := 64
ODSSize := 16
eds.TestSuiteAccessor(ctx, t, createQ1Q4File, ODSSize)
}

Expand Down

0 comments on commit 19d8d47

Please sign in to comment.