@@ -106,8 +106,8 @@ func TestProcess_BrokenModelConfig(t *testing.T) {
106106
107107 w = httptest .NewRecorder ()
108108 process .ProxyRequest (w , req )
109- assert .Equal (t , http .StatusServiceUnavailable , w .Code )
110- assert .Contains (t , w .Body .String (), "Process can not ProxyRequest, state is failed" )
109+ assert .Equal (t , http .StatusBadGateway , w .Code )
110+ assert .Contains (t , w .Body .String (), "start() failed: " )
111111}
112112
113113func TestProcess_UnloadAfterTTL (t * testing.T ) {
@@ -248,18 +248,14 @@ func TestProcess_SwapState(t *testing.T) {
248248 }{
249249 {"Stopped to Starting" , StateStopped , StateStopped , StateStarting , nil , StateStarting },
250250 {"Starting to Ready" , StateStarting , StateStarting , StateReady , nil , StateReady },
251- {"Starting to Failed" , StateStarting , StateStarting , StateFailed , nil , StateFailed },
252251 {"Starting to Stopping" , StateStarting , StateStarting , StateStopping , nil , StateStopping },
252+ {"Starting to Stopped" , StateStarting , StateStarting , StateStopped , nil , StateStopped },
253253 {"Ready to Stopping" , StateReady , StateReady , StateStopping , nil , StateStopping },
254254 {"Stopping to Stopped" , StateStopping , StateStopping , StateStopped , nil , StateStopped },
255255 {"Stopping to Shutdown" , StateStopping , StateStopping , StateShutdown , nil , StateShutdown },
256256 {"Stopped to Ready" , StateStopped , StateStopped , StateReady , ErrInvalidStateTransition , StateStopped },
257- {"Starting to Stopped" , StateStarting , StateStarting , StateStopped , ErrInvalidStateTransition , StateStarting },
258257 {"Ready to Starting" , StateReady , StateReady , StateStarting , ErrInvalidStateTransition , StateReady },
259- {"Ready to Failed" , StateReady , StateReady , StateFailed , ErrInvalidStateTransition , StateReady },
260258 {"Stopping to Ready" , StateStopping , StateStopping , StateReady , ErrInvalidStateTransition , StateStopping },
261- {"Failed to Stopped" , StateFailed , StateFailed , StateStopped , ErrInvalidStateTransition , StateFailed },
262- {"Failed to Starting" , StateFailed , StateFailed , StateStarting , ErrInvalidStateTransition , StateFailed },
263259 {"Shutdown to Stopped" , StateShutdown , StateShutdown , StateStopped , ErrInvalidStateTransition , StateShutdown },
264260 {"Shutdown to Starting" , StateShutdown , StateShutdown , StateStarting , ErrInvalidStateTransition , StateShutdown },
265261 {"Expected state mismatch" , StateStopped , StateStarting , StateStarting , ErrExpectedStateMismatch , StateStopped },
0 commit comments