mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-11 00:40:00 +08:00
optimize: improve breaker algorithm on recovery time (#4077)
This commit is contained in:
@@ -302,10 +302,10 @@ func TestQueryRowsScanTimeout(t *testing.T) {
|
||||
Foo string
|
||||
}
|
||||
conn := NewSqlConnFromDB(db)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
|
||||
defer cancel()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*2)
|
||||
err := conn.QueryRowsCtx(ctx, &val, "any")
|
||||
assert.ErrorIs(t, err, context.DeadlineExceeded)
|
||||
cancel()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user