Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

br,test: fix data race for parquet test #27482

Merged
merged 8 commits into from
Aug 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions br/pkg/lightning/mydump/parquet_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"io"
"path/filepath"
"strconv"
"time"

. "github.com/pingcap/check"
"github.com/pingcap/tidb/br/pkg/storage"
Expand Down Expand Up @@ -82,13 +81,6 @@ func (s testParquetParserSuite) TestParquetParser(c *C) {
}

func (s testParquetParserSuite) TestParquetVariousTypes(c *C) {
// those deprecated TIME/TIMESTAMP types depend on the local timezone!
prevTZ := time.Local
time.Local = time.FixedZone("UTC+8", 8*60*60)
defer func() {
time.Local = prevTZ
}()

type Test struct {
Date int32 `parquet:"name=date, type=DATE"`
TimeMillis int32 `parquet:"name=timemillis, type=TIME_MILLIS"`
Expand All @@ -114,7 +106,7 @@ func (s testParquetParserSuite) TestParquetVariousTypes(c *C) {

v := &Test{
Date: 18564, // 2020-10-29
TimeMillis: 62775123, // 17:26:15.123 (note all time are in UTC+8!)
TimeMillis: 62775123, // 17:26:15.123
TimeMicros: 62775123456, // 17:26:15.123
TimestampMillis: 1603963672356, // 2020-10-29T09:27:52.356Z
TimestampMicros: 1603963672356956, // 2020-10-29T09:27:52.356956Z
Expand Down