Fixed comment about raftIndex + use test.Helper()

This commit is contained in:
Pierre Souchay 2018-02-19 19:30:25 +01:00
parent 6cb0846d58
commit bac8fb046f
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
}
// 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 {

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) {
idx, services, err := s.ServiceNodes(ws, serviceID)
t.Helper()
if err != nil {
t.Fatalf("err: %s", err)
}