mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #6196 from gyuho/clockwork
vendor: use v0.1.0 clockwork
This commit is contained in:
commit
38c370a7c5
18
cmd/vendor/github.com/jonboulle/clockwork/clockwork.go
generated
vendored
18
cmd/vendor/github.com/jonboulle/clockwork/clockwork.go
generated
vendored
@ -32,10 +32,17 @@ func NewRealClock() Clock {
|
||||
}
|
||||
|
||||
// NewFakeClock returns a FakeClock implementation which can be
|
||||
// manually advanced through time for testing.
|
||||
// manually advanced through time for testing. The initial time of the
|
||||
// FakeClock will be an arbitrary non-zero time.
|
||||
func NewFakeClock() FakeClock {
|
||||
// use a fixture that does not fulfill Time.IsZero()
|
||||
return NewFakeClockAt(time.Date(1984, time.April, 4, 0, 0, 0, 0, time.UTC))
|
||||
}
|
||||
|
||||
// NewFakeClockAt returns a FakeClock initialised at the given time.Time.
|
||||
func NewFakeClockAt(t time.Time) FakeClock {
|
||||
return &fakeClock{
|
||||
l: sync.RWMutex{},
|
||||
time: t,
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,9 +124,10 @@ func (fc *fakeClock) Sleep(d time.Duration) {
|
||||
|
||||
// Time returns the current time of the fakeClock
|
||||
func (fc *fakeClock) Now() time.Time {
|
||||
fc.l.Lock()
|
||||
defer fc.l.Unlock()
|
||||
return fc.time
|
||||
fc.l.RLock()
|
||||
t := fc.time
|
||||
fc.l.RUnlock()
|
||||
return t
|
||||
}
|
||||
|
||||
// Advance advances fakeClock to a new point in time, ensuring channels from any
|
||||
|
@ -736,14 +736,14 @@ func TestServeMembersCreate(t *testing.T) {
|
||||
t.Errorf("cid = %s, want %s", gcid, wcid)
|
||||
}
|
||||
|
||||
wb := `{"id":"2a86a83729b330d5","name":"","peerURLs":["http://127.0.0.1:1"],"clientURLs":[]}` + "\n"
|
||||
wb := `{"id":"c29b431f04be0bc7","name":"","peerURLs":["http://127.0.0.1:1"],"clientURLs":[]}` + "\n"
|
||||
g := rw.Body.String()
|
||||
if g != wb {
|
||||
t.Errorf("got body=%q, want %q", g, wb)
|
||||
}
|
||||
|
||||
wm := membership.Member{
|
||||
ID: 3064321551348478165,
|
||||
ID: 14022875665250782151,
|
||||
RaftAttributes: membership.RaftAttributes{
|
||||
PeerURLs: []string{"http://127.0.0.1:1"},
|
||||
},
|
||||
|
6
glide.lock
generated
6
glide.lock
generated
@ -1,5 +1,5 @@
|
||||
hash: c04a6b4fa79b3e780e38f875e3863551c8a7e5a1d1020b9a3a06268d50e592e3
|
||||
updated: 2016-08-15T15:51:12.533454067-07:00
|
||||
hash: 772308b285e752f35b2e87f75271501d23bbd9e72840dd1980fc6cf38a406b69
|
||||
updated: 2016-08-16T16:30:32.22550013-07:00
|
||||
imports:
|
||||
- name: bitbucket.org/ww/goautoneg
|
||||
version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675
|
||||
@ -64,7 +64,7 @@ imports:
|
||||
- name: github.com/inconshreveable/mousetrap
|
||||
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
|
||||
- name: github.com/jonboulle/clockwork
|
||||
version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982
|
||||
version: 2eee05ed794112d45db504eb05aa693efd2b8b09
|
||||
- name: github.com/kballard/go-shellquote
|
||||
version: d8ec1a69a250a17bb0e419c386eac1f3711dc142
|
||||
- name: github.com/kr/pty
|
||||
|
@ -62,7 +62,7 @@ import:
|
||||
- package: github.com/inconshreveable/mousetrap
|
||||
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
|
||||
- package: github.com/jonboulle/clockwork
|
||||
version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982
|
||||
version: v0.1.0
|
||||
- package: github.com/kballard/go-shellquote
|
||||
version: d8ec1a69a250a17bb0e419c386eac1f3711dc142
|
||||
- package: github.com/kr/pty
|
||||
|
Loading…
x
Reference in New Issue
Block a user