@@ -1108,7 +1108,7 @@ func TestSampleFileCompressRatio(t *testing.T) {
1108
1108
require .InDelta (t , ratio , 5000.0 / float64 (bf .Len ()), 1e-5 )
1109
1109
}
1110
1110
1111
- func TestSampleParquetDataSize (t * testing.T ) {
1111
+ func testSampleParquetDataSize (t * testing.T , count int ) {
1112
1112
s := newTestMydumpLoaderSuite (t )
1113
1113
store , err := storage .NewLocalStorage (s .sourceDir )
1114
1114
require .NoError (t , err )
@@ -1133,7 +1133,7 @@ func TestSampleParquetDataSize(t *testing.T) {
1133
1133
t .Logf ("seed: %d. To reproduce the random behaviour, manually set `rand.New(rand.NewSource(seed))`" , seed )
1134
1134
rnd := rand .New (rand .NewSource (seed ))
1135
1135
totalRowSize := 0
1136
- for i := 0 ; i < 1000 ; i ++ {
1136
+ for i := 0 ; i < count ; i ++ {
1137
1137
kl := rnd .Intn (20 ) + 1
1138
1138
key := make ([]byte , kl )
1139
1139
kl , err = rnd .Read (key )
@@ -1167,6 +1167,11 @@ func TestSampleParquetDataSize(t *testing.T) {
1167
1167
require .InDelta (t , totalRowSize , size , float64 (totalRowSize )/ 10 )
1168
1168
}
1169
1169
1170
+ func TestSampleParquetDataSize (t * testing.T ) {
1171
+ t .Run ("count=1000" , func (t * testing.T ) { testSampleParquetDataSize (t , 1000 ) })
1172
+ t .Run ("count=0" , func (t * testing.T ) { testSampleParquetDataSize (t , 0 ) })
1173
+ }
1174
+
1170
1175
func TestSetupOptions (t * testing.T ) {
1171
1176
// those functions are only used in other components, add this to avoid they
1172
1177
// be deleted mistakenly.
0 commit comments