Skip to content

Commit

Permalink
chore: use deferred unlock
Browse files Browse the repository at this point in the history
Switch to a deferred unlock to ensure safety.

Co-authored-by: Manuel de la Peña <[email protected]>
  • Loading branch information
stevenh and mdelapenya authored Aug 7, 2024
1 parent e97bc1a commit 1decf72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wait/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func (st *healthStrategyTarget) State(ctx context.Context) (*types.ContainerStat

func (st *healthStrategyTarget) setState(health *types.Health) {
st.mtx.Lock()
defer st.mtx.Unlock()
st.state.Health = health
st.mtx.Unlock()
}

// TestWaitForHealthTimesOutForUnhealthy confirms that an unhealthy container will eventually
Expand Down

0 comments on commit 1decf72

Please sign in to comment.