Skip to content

Commit

Permalink
local var
Browse files Browse the repository at this point in the history
  • Loading branch information
buchuitoudegou committed Jan 10, 2023
1 parent 8260894 commit cd6e96e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion br/pkg/lightning/mydump/csv_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import (

var ioWorkers = worker.NewPool(context.Background(), 5, "test_csv")

var largestEntryLimit int

func init() {
largestEntryLimit = tidbconfig.MaxTxnEntrySizeLimit
}

func assertPosEqual(t *testing.T, parser mydump.Parser, expectPos, expectRowID int64) {
pos, rowID := parser.Pos()
require.Equal(t, expectPos, pos)
Expand Down Expand Up @@ -692,7 +698,7 @@ func TestTooLargeRow(t *testing.T) {
var testCase bytes.Buffer
testCase.WriteString("a,b,c,d")
// WARN: will take up 120MB memory here.
for i := 0; i < tidbconfig.MaxTxnEntrySizeLimit; i++ {
for i := 0; i < largestEntryLimit; i++ {
testCase.WriteByte('d')
}
charsetConvertor, err := mydump.NewCharsetConvertor(cfg.DataCharacterSet, cfg.DataInvalidCharReplace)
Expand Down

0 comments on commit cd6e96e

Please sign in to comment.