fix broken test

see
Yasuhiro Matsumoto 2017-09-28 12:45:09 +09:00
parent 49f9543f14
commit c0f3d4135e
1 changed files with 3 additions and 3 deletions

View File

@ -127,11 +127,11 @@ func TestShortTimeout(t *testing.T) {
FROM test_table
ORDER BY key2 ASC`
rows, err := db.QueryContext(ctx, query)
if err != nil && context.DeadlineExceeded {
if err != nil && err != context.DeadlineExceeded {
t.Fatal(err)
}
if ctx.Err() != nil && context.DeadlineExceeded != ctx.Err() {
t.Fatalf(ctx.Err())
if ctx.Err() != nil && ctx.Err() != context.DeadlineExceeded {
t.Fatal(ctx.Err())
}
rows.Close()
}