Skip to content

Commit 012c451

Browse files
committed
test(contrib/drivers/mysql): add nil check before accessing err.Error() in Test_DB_Ctx
1 parent 6204c13 commit 012c451

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

contrib/drivers/mysql/mysql_z_unit_core_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,7 @@ func Test_DB_Ctx(t *testing.T) {
15701570
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
15711571
defer cancel()
15721572
_, err := db.Query(ctx, "SELECT SLEEP(10)")
1573+
t.AssertNE(err, nil)
15731574
t.Assert(gstr.Contains(err.Error(), "deadline"), true)
15741575
})
15751576
}

0 commit comments

Comments
 (0)