Duration order consistency when multiplying number by time unit
This commit is contained in:
parent
9ef4f47ba0
commit
bd75eddc8e
6 changed files with 6 additions and 6 deletions
|
@ -349,7 +349,7 @@ func (s *GRPCSuite) TestGRPCBuffer(c *check.C) {
|
||||||
received <- true
|
received <- true
|
||||||
}()
|
}()
|
||||||
|
|
||||||
err = try.Do(time.Second*10, func() error {
|
err = try.Do(10*time.Second, func() error {
|
||||||
select {
|
select {
|
||||||
case <-received:
|
case <-received:
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -705,7 +705,7 @@ func (s *SimpleSuite) TestMirrorCanceled(c *check.C) {
|
||||||
|
|
||||||
main := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
main := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
||||||
atomic.AddInt32(&count, 1)
|
atomic.AddInt32(&count, 1)
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(2 * time.Second)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
mirror1 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
mirror1 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
|
|
@ -139,7 +139,7 @@ func TestProvideWithWatch(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout = time.After(time.Second * 1)
|
timeout = time.After(1 * time.Second)
|
||||||
var numUpdates, numServices, numRouters, numTLSConfs int
|
var numUpdates, numServices, numRouters, numTLSConfs int
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
|
|
@ -151,7 +151,7 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Provider) intervalPoll(ctx context.Context, client rancher.Client, updateConfiguration func(string)) {
|
func (p *Provider) intervalPoll(ctx context.Context, client rancher.Client, updateConfiguration func(string)) {
|
||||||
ticker := time.NewTicker(time.Second * time.Duration(p.RefreshSeconds))
|
ticker := time.NewTicker(time.Duration(p.RefreshSeconds) * time.Second)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
var version string
|
var version string
|
||||||
|
|
|
@ -51,7 +51,7 @@ func (m *Manager) BuildTCP(rootCtx context.Context, serviceName string) (tcp.Han
|
||||||
defaultTerminationDelay := 100
|
defaultTerminationDelay := 100
|
||||||
conf.LoadBalancer.TerminationDelay = &defaultTerminationDelay
|
conf.LoadBalancer.TerminationDelay = &defaultTerminationDelay
|
||||||
}
|
}
|
||||||
duration := time.Millisecond * time.Duration(*conf.LoadBalancer.TerminationDelay)
|
duration := time.Duration(*conf.LoadBalancer.TerminationDelay) * time.Millisecond
|
||||||
|
|
||||||
for name, server := range conf.LoadBalancer.Servers {
|
for name, server := range conf.LoadBalancer.Servers {
|
||||||
if _, _, err := net.SplitHostPort(server.Address); err != nil {
|
if _, _, err := net.SplitHostPort(server.Address); err != nil {
|
||||||
|
|
|
@ -24,7 +24,7 @@ func fakeRedis(t *testing.T, listener net.Listener) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(buf[:4]) == "ping" {
|
if string(buf[:4]) == "ping" {
|
||||||
time.Sleep(time.Millisecond * 1)
|
time.Sleep(1 * time.Millisecond)
|
||||||
if _, err := conn.Write([]byte("PONG")); err != nil {
|
if _, err := conn.Write([]byte("PONG")); err != nil {
|
||||||
conn.Close()
|
conn.Close()
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue