From 955d8ee698cd960b3431355e10a0ed9bdb454f8e Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Fri, 1 Jun 2018 19:32:21 -0700 Subject: [PATCH] require 1.9 or above, bug fix in test --- README.md | 2 +- server/monitor_test.go | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ab8aee1e..ccc18f38 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/server/monitor_test.go b/server/monitor_test.go index 33047c22..b944414f 100644 --- a/server/monitor_test.go +++ b/server/monitor_test.go @@ -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") } }