From 523feb0be4e3ee4ced524eb21a50a0bcf9952425 Mon Sep 17 00:00:00 2001
From: Pierre Souchay
Date: Mon, 19 Feb 2018 19:30:25 +0100
Subject: [PATCH] Fixed comment about raftIndex + use test.Helper()
---
agent/consul/state/catalog.go | 6 +++---
agent/consul/state/catalog_test.go | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/agent/consul/state/catalog.go b/agent/consul/state/catalog.go
index 16fb62cdf..9c3cb3a29 100644
--- a/agent/consul/state/catalog.go
+++ b/agent/consul/state/catalog.go
@@ -759,9 +759,9 @@ func (s *Store) ServicesByNodeMeta(ws memdb.WatchSet, filters map[string]string)
return idx, results, nil
}
-// maxIndexForService return the maximum transaction number for a service
-// If the transaction is not set for the service, it will return the max
-// transaction number of "nodes", "services"
+// maxIndexForService return the maximum Raft Index for a service
+// If the index is not set for the service, it will return the max
+// Raft Index of "nodes", "services"
func maxIndexForService(tx *memdb.Txn, serviceName string) (uint64, error) {
transaction, err := tx.First("index", "id", serviceIndexName(serviceName))
if err == nil {
diff --git a/agent/consul/state/catalog_test.go b/agent/consul/state/catalog_test.go
index f3d9f3e8d..89745389e 100644
--- a/agent/consul/state/catalog_test.go
+++ b/agent/consul/state/catalog_test.go
@@ -2168,6 +2168,7 @@ func TestStateStore_DeleteCheck(t *testing.T) {
func ensureServiceVersion(t *testing.T, s *Store, ws memdb.WatchSet, serviceID string, expectedIdx uint64, expectedSize int) {
idx, services, err := s.ServiceNodes(ws, serviceID)
+ t.Helper()
if err != nil {
t.Fatalf("err: %s", err)
}