Skip to content

Commit fc476f6

Browse files
committed
more error check where it won't hide other errors
1 parent 112556b commit fc476f6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/handler_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,13 +791,13 @@ func TestHandlerKillQuery(t *testing.T) {
791791
var wg sync.WaitGroup
792792
wg.Add(1)
793793
sleepQuery := "SELECT SLEEP(100000)"
794+
var sleepErr error
794795
go func() {
795796
defer wg.Done()
796797
// need a local |err| variable to avoid being overwritten
797-
_ = handler.ComQuery(context.Background(), conn1, sleepQuery, func(res *sqltypes.Result, more bool) error {
798+
sleepErr = handler.ComQuery(context.Background(), conn1, sleepQuery, func(res *sqltypes.Result, more bool) error {
798799
return nil
799800
})
800-
//require.Error(serr)
801801
}()
802802

803803
time.Sleep(100 * time.Millisecond)
@@ -831,6 +831,8 @@ func TestHandlerKillQuery(t *testing.T) {
831831
})
832832
require.NoError(err)
833833
wg.Wait()
834+
require.Error(sleepErr)
835+
834836
time.Sleep(100 * time.Millisecond)
835837
err = handler.ComQuery(context.Background(), conn2, "SHOW PROCESSLIST", func(res *sqltypes.Result, more bool) error {
836838
// 1, , , test, Sleep, 0, ,

0 commit comments

Comments
 (0)