From 386e2040d545205a0f77857c2b2194907aebd072 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Tue, 21 Mar 2023 10:58:41 +0800 Subject: [PATCH] test: fix flaky test due to forget to change batch size (#42408) close pingcap/tidb#42402 --- executor/asyncloaddata/operate_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/executor/asyncloaddata/operate_test.go b/executor/asyncloaddata/operate_test.go index b8cc67467e5b0..4ea53ed7f5188 100644 --- a/executor/asyncloaddata/operate_test.go +++ b/executor/asyncloaddata/operate_test.go @@ -65,7 +65,6 @@ func (s *mockGCSSuite) TestOperateRunningJob() { tk2.MustContainErrMsg(sql, "failed to keepalive") }() - // TODO: remove this sleep after moving mysql.load_data_jobs to bootstrap time.Sleep(3 * time.Second) rows := s.tk.MustQuery("SHOW LOAD DATA JOBS;").Rows() require.Greater(s.T(), len(rows), 0) @@ -76,14 +75,14 @@ func (s *mockGCSSuite) TestOperateRunningJob() { // test CANCEL sql = fmt.Sprintf(`LOAD DATA INFILE 'gs://test-operate/t.tsv?endpoint=%s' - REPLACE INTO TABLE test_operate.t;`, gcsEndpoint) + REPLACE INTO TABLE test_operate.t WITH batch_size = 1;`, gcsEndpoint) wg.Add(1) go func() { defer wg.Done() tk2.MustContainErrMsg(sql, "failed to keepalive") }() - time.Sleep(3 * time.Second) + time.Sleep(time.Second) rows = s.tk.MustQuery("SHOW LOAD DATA JOBS;").Rows() require.Greater(s.T(), len(rows), 0) jobID = rows[len(rows)-1][0].(string)