Skip to content

Commit

Permalink
executor: fix data race for test TestInterruptedDuringSpilling (#50693)
Browse files Browse the repository at this point in the history
close #50688
  • Loading branch information
wshwsh12 authored Jan 24, 2024
1 parent eca5f20 commit 0568385
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/util/chunk/row_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,17 @@ func TestInterruptedDuringSpilling(t *testing.T) {
for i := 0; i < 102400; i++ {
rc.Add(chk)
}
wg := sync.WaitGroup{}
wg.Add(1)
var cancelTime time.Time
go func() {
time.Sleep(200 * time.Millisecond)
rootTracker.Killer.SendKillSignal(sqlkiller.QueryInterrupted)
cancelTime = time.Now()
wg.Done()
}()
rc.spillToDisk(nil)
wg.Wait()
cancelDuration := time.Since(cancelTime)
require.Less(t, cancelDuration, 1*time.Second)
}
Expand Down

0 comments on commit 0568385

Please sign in to comment.