require 1.9 or above, bug fix in test

This commit is contained in:
Derek Collison
2018-06-01 19:32:21 -07:00
parent 3e2e8c9ce5
commit 955d8ee698
2 changed files with 13 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ A High Performance [NATS](https://nats.io) Server written in [Go](http://golang.
## Quickstart
If you just want to start using NATS, and you have [installed Go](https://golang.org/doc/install) 1.5+ and set your $GOPATH:
If you just want to start using NATS, and you have [installed Go](https://golang.org/doc/install) 1.9+ and set your $GOPATH:
Install and run the NATS server:

View File

@@ -170,6 +170,8 @@ func TestHandleVarz(t *testing.T) {
}
}
time.Sleep(100 * time.Millisecond)
nc := createClientConnSubscribeAndPublish(t, s)
defer nc.Close()
@@ -413,26 +415,26 @@ func TestConnzLastActivity(t *testing.T) {
// between first and last.
time.Sleep(200 * time.Millisecond)
// Unsub should trigger as well
sub.Unsubscribe()
// Message delivery should trigger as well
nc.Publish("hello.world", []byte("Hello"))
nc.Flush()
ci = pollConz(t, s, mode, url, opts).Conns[0]
pubLast = ci.LastActivity
if subLast.Equal(pubLast) {
t.Fatalf("Un-subscribe should have triggered update to LastActivity\n")
msgLast := ci.LastActivity
if pubLast.Equal(msgLast) {
t.Fatalf("Message delivery should have triggered update to LastActivity\n")
}
// Just wait a bit to make sure that there is a difference
// between first and last.
time.Sleep(200 * time.Millisecond)
// Message delivery should trigger as well
nc.Publish("foo", []byte("Hello"))
// Unsub should trigger as well
sub.Unsubscribe()
nc.Flush()
ci = pollConz(t, s, mode, url, opts).Conns[0]
msgLast := ci.LastActivity
if pubLast.Equal(msgLast) {
t.Fatalf("Message delivery should have triggered update to LastActivity\n")
unsubLast := ci.LastActivity
if msgLast.Equal(unsubLast) {
t.Fatalf("Un-subscribe should have triggered update to LastActivity\n")
}
}