@@ -229,19 +229,21 @@ func TestStartRemoving_Error(t *testing.T) {
229229 assert .False (t , alreadyDone2 )
230230 assert .Nil (t , finish2 )
231231
232- // From Failed state, no transitions are allowed
232+ // Failed transition should be cleared so subsequent transitions can proceed.
233233 alreadyDone3 , finish3 , err3 := startRemoving (ctx , sbx , sandbox.RemoveOpts {Action : sandbox .StateActionPause })
234- require .Error (t , err3 )
235- require .ErrorIs (t , err3 , failureErr )
234+ require .NoError (t , err3 )
236235 assert .False (t , alreadyDone3 )
237- assert .Nil (t , finish3 )
236+ require .NotNil (t , finish3 )
237+ finish3 (ctx , nil )
238+ assert .Equal (t , sandbox .StatePausing , sbx .State ())
238239
239- // Trying to transition to Killed should also fail
240+ // Follow-up transition should also work.
240241 alreadyDone4 , finish4 , err4 := startRemoving (ctx , sbx , sandbox.RemoveOpts {Action : sandbox .StateActionKill })
241- require .Error (t , err4 )
242- require .ErrorIs (t , err4 , failureErr )
242+ require .NoError (t , err4 )
243243 assert .False (t , alreadyDone4 )
244- assert .Nil (t , finish4 )
244+ require .NotNil (t , finish4 )
245+ finish4 (ctx , nil )
246+ assert .Equal (t , sandbox .StateKilling , sbx .State ())
245247}
246248
247249// Test context timeout during wait
0 commit comments