mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 11:48:43 -07:00
require 1.9 or above, bug fix in test
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user