Skip to content

Commit

Permalink
Rename change to "recover-service" (to distinguish from "recover-check")
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoyt committed May 9, 2022
1 parent d91e700 commit 5074a36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion internal/overlord/servstate/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ func (s *serviceData) openRecoverChange() {
st.Lock()
defer st.Unlock()

s.recoverChange = st.NewChange("recover", fmt.Sprintf("Recover service %q", s.config.Name))
s.recoverChange = st.NewChange("recover-service", fmt.Sprintf("Recover service %q", s.config.Name))
}

func calculateNextBackoff(config *plan.Service, current time.Duration) time.Duration {
Expand Down
20 changes: 10 additions & 10 deletions internal/overlord/servstate/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -891,13 +891,13 @@ services:
c.Assert(svc.Current, Equals, servstate.StatusActive)
c.Check(s.logBufferString(), Matches, `2.* \[test2\] test2\n`)

// Ensure it has recorded the "recover" change correctly.
// Ensure it has recorded the "recover-service" change correctly.
func() {
s.st.Lock()
defer s.st.Unlock()
var changes []*state.Change
for _, chg := range s.st.Changes() {
if chg.Kind() == "recover" {
if chg.Kind() == "recover-service" {
changes = append(changes, chg)
}
}
Expand Down Expand Up @@ -929,12 +929,12 @@ services:
c.Assert(svc.Current, Equals, servstate.StatusActive)
c.Check(s.logBufferString(), Matches, `2.* \[test2\] test2\n`)

// Ensure it has recorded the "recover" changes correctly.
// Ensure it has recorded the "recover-service" changes correctly.
s.st.Lock()
defer s.st.Unlock()
var changes []*state.Change
for _, chg := range s.st.Changes() {
if chg.Kind() == "recover" {
if chg.Kind() == "recover-service" {
changes = append(changes, chg)
}
}
Expand Down Expand Up @@ -981,12 +981,12 @@ services:
return svc.Current == servstate.StatusInactive
})

// Ensure it has recorded the "recover" change correctly.
// Ensure it has recorded the "recover-service" change correctly.
s.st.Lock()
defer s.st.Unlock()
var changes []*state.Change
for _, chg := range s.st.Changes() {
if chg.Kind() == "recover" {
if chg.Kind() == "recover-service" {
changes = append(changes, chg)
}
}
Expand Down Expand Up @@ -1084,12 +1084,12 @@ checks:
c.Assert(svc.Current, Equals, servstate.StatusActive)
c.Assert(s.manager.BackoffNum("test2"), Equals, 1)

// Ensure it has recorded the "recover" change correctly.
// Ensure it has recorded the "recover-service" change correctly.
s.st.Lock()
defer s.st.Unlock()
var changes []*state.Change
for _, chg := range s.st.Changes() {
if chg.Kind() == "recover" {
if chg.Kind() == "recover-service" {
changes = append(changes, chg)
}
}
Expand Down Expand Up @@ -1178,12 +1178,12 @@ checks:
c.Assert(checks[0].Status, Equals, checkstate.CheckStatusDown)
c.Assert(checks[0].LastError, Matches, ".* executable file not found .*")

// Ensure it has recorded the "recover" change correctly.
// Ensure it has recorded the "recover-service" change correctly.
s.st.Lock()
defer s.st.Unlock()
var changes []*state.Change
for _, chg := range s.st.Changes() {
if chg.Kind() == "recover" {
if chg.Kind() == "recover-service" {
changes = append(changes, chg)
}
}
Expand Down

0 comments on commit 5074a36

Please sign in to comment.