From 19d8d477faba754500ad9649d64448abdfc4c45d Mon Sep 17 00:00:00 2001 From: Vlad <13818348+walldiss@users.noreply.github.com> Date: Tue, 2 Jul 2024 22:51:02 +0200 Subject: [PATCH] lower max size for tests --- share/new_eds/proofs_cache_test.go | 4 ++-- share/new_eds/reader_test.go | 10 ---------- share/new_eds/rsmt2d_test.go | 4 ++-- store/file/ods_test.go | 4 ++-- store/file/q1q4_file_test.go | 4 ++-- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/share/new_eds/proofs_cache_test.go b/share/new_eds/proofs_cache_test.go index 4552e4b862..b570b15c1e 100644 --- a/share/new_eds/proofs_cache_test.go +++ b/share/new_eds/proofs_cache_test.go @@ -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 { diff --git a/share/new_eds/reader_test.go b/share/new_eds/reader_test.go index 7c2ab57e82..7b05b17b69 100644 --- a/share/new_eds/reader_test.go +++ b/share/new_eds/reader_test.go @@ -2,7 +2,6 @@ package eds import ( "errors" - "fmt" "io" "math/rand" "testing" @@ -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 } @@ -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 } } diff --git a/share/new_eds/rsmt2d_test.go b/share/new_eds/rsmt2d_test.go index 3a571027f6..ef4fdae7bc 100644 --- a/share/new_eds/rsmt2d_test.go +++ b/share/new_eds/rsmt2d_test.go @@ -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) diff --git a/store/file/ods_test.go b/store/file/ods_test.go index 575b265fc0..307689092c 100644 --- a/store/file/ods_test.go +++ b/store/file/ods_test.go @@ -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) diff --git a/store/file/q1q4_file_test.go b/store/file/q1q4_file_test.go index 2c5c9b4065..d739ad40ba 100644 --- a/store/file/q1q4_file_test.go +++ b/store/file/q1q4_file_test.go @@ -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) }