Fixed comment about raftIndex + use test.Helper()

This commit is contained in:
Pierre Souchay 2018-02-19 19:30:25 +01:00
parent a77b36bd4b
commit 523feb0be4
2 changed files with 4 additions and 3 deletions

View File

@ -759,9 +759,9 @@ func (s *Store) ServicesByNodeMeta(ws memdb.WatchSet, filters map[string]string)
return idx, results, nil return idx, results, nil
} }
// maxIndexForService return the maximum transaction number for a service // maxIndexForService return the maximum Raft Index for a service
// If the transaction is not set for the service, it will return the max // If the index is not set for the service, it will return the max
// transaction number of "nodes", "services" // Raft Index of "nodes", "services"
func maxIndexForService(tx *memdb.Txn, serviceName string) (uint64, error) { func maxIndexForService(tx *memdb.Txn, serviceName string) (uint64, error) {
transaction, err := tx.First("index", "id", serviceIndexName(serviceName)) transaction, err := tx.First("index", "id", serviceIndexName(serviceName))
if err == nil { if err == nil {

View File

@ -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) { func ensureServiceVersion(t *testing.T, s *Store, ws memdb.WatchSet, serviceID string, expectedIdx uint64, expectedSize int) {
idx, services, err := s.ServiceNodes(ws, serviceID) idx, services, err := s.ServiceNodes(ws, serviceID)
t.Helper()
if err != nil { if err != nil {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", err)
} }