Skip to content

Commit

Permalink
Merge pull request #656 from nats-io/fix_lastactivity_test
Browse files Browse the repository at this point in the history
Fix last activity monitoring test
  • Loading branch information
kozlovic authored Mar 23, 2018
2 parents c587035 + 705d8f5 commit add6d79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ func (c *client) processSub(argo []byte) (err error) {
c.traceInOp("SUB", argo)

// Indicate activity.
c.cache.subs += 1
c.cache.subs++

// Copy so we do not reference a potentially large buffer
arg := make([]byte, len(argo))
Expand Down
7 changes: 1 addition & 6 deletions server/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ func TestConnzLastActivity(t *testing.T) {
defer nc.Close()
nc.Flush()

nc2 := createClientConnSubscribeAndPublish(t, s)
defer nc2.Close()
nc2.Flush()

// Test inside details of each connection
ci := pollConz(t, s, mode, url, opts).Conns[0]
if len(ci.Subs) != 1 {
Expand Down Expand Up @@ -429,8 +425,7 @@ func TestConnzLastActivity(t *testing.T) {
time.Sleep(100 * time.Millisecond)

// Message delivery should trigger as well
nc2.Publish("foo", []byte("Hello"))
nc2.Flush()
nc.Publish("foo", []byte("Hello"))
nc.Flush()
ci = pollConz(t, s, mode, url, opts).Conns[0]
msgLast := ci.LastActivity
Expand Down

0 comments on commit add6d79

Please sign in to comment.