Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
  • Loading branch information
mxpv committed Jul 15, 2022
1 parent 60f51c1 commit 3a3f43f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
15 changes: 5 additions & 10 deletions pkg/cri/store/container/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ func TestStatus(t *testing.T) {

t.Logf("failed update should not take effect")
err = s.Update(func(o Status) (Status, error) {
o = updateStatus
return o, updateErr
return updateStatus, updateErr
})
assert.Equal(updateErr, err)
assert.Equal(testStatus, s.Get())
Expand All @@ -142,8 +141,7 @@ func TestStatus(t *testing.T) {

t.Logf("successful update should take effect but not checkpoint")
err = s.Update(func(o Status) (Status, error) {
o = updateStatus
return o, nil
return updateStatus, nil
})
assert.NoError(err)
assert.Equal(updateStatus, s.Get())
Expand All @@ -152,14 +150,12 @@ func TestStatus(t *testing.T) {
assert.Equal(testStatus, loaded)
// Recover status.
assert.NoError(s.Update(func(o Status) (Status, error) {
o = testStatus
return o, nil
return testStatus, nil
}))

t.Logf("failed update sync should not take effect")
err = s.UpdateSync(func(o Status) (Status, error) {
o = updateStatus
return o, updateErr
return updateStatus, updateErr
})
assert.Equal(updateErr, err)
assert.Equal(testStatus, s.Get())
Expand All @@ -169,8 +165,7 @@ func TestStatus(t *testing.T) {

t.Logf("successful update sync should take effect and checkpoint")
err = s.UpdateSync(func(o Status) (Status, error) {
o = updateStatus
return o, nil
return updateStatus, nil
})
assert.NoError(err)
assert.Equal(updateStatus, s.Get())
Expand Down
6 changes: 2 additions & 4 deletions pkg/cri/store/sandbox/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ func TestStatus(t *testing.T) {

t.Logf("failed update should not take effect")
err := s.Update(func(o Status) (Status, error) {
o = updateStatus
return o, updateErr
return updateStatus, updateErr
})
assert.Equal(updateErr, err)
assert.Equal(testStatus, s.Get())

t.Logf("successful update should take effect but not checkpoint")
err = s.Update(func(o Status) (Status, error) {
o = updateStatus
return o, nil
return updateStatus, nil
})
assert.NoError(err)
assert.Equal(updateStatus, s.Get())
Expand Down

0 comments on commit 3a3f43f

Please sign in to comment.