@@ -27,7 +27,7 @@ func TestProxyManager_SwapProcessCorrectly(t *testing.T) {
2727 })
2828
2929 proxy := New (config )
30- defer proxy .StopProcesses ()
30+ defer proxy .StopProcesses (StopWaitForInflightRequest )
3131
3232 for _ , modelName := range []string {"model1" , "model2" } {
3333 reqBody := fmt .Sprintf (`{"model":"%s"}` , modelName )
@@ -63,7 +63,7 @@ func TestProxyManager_SwapMultiProcess(t *testing.T) {
6363 })
6464
6565 proxy := New (config )
66- defer proxy .StopProcesses ()
66+ defer proxy .StopProcesses (StopWaitForInflightRequest )
6767
6868 tests := []string {"model1" , "model2" }
6969 for _ , requestedModel := range tests {
@@ -105,7 +105,7 @@ func TestProxyManager_PersistentGroupsAreNotSwapped(t *testing.T) {
105105 })
106106
107107 proxy := New (config )
108- defer proxy .StopProcesses ()
108+ defer proxy .StopProcesses (StopWaitForInflightRequest )
109109
110110 // make requests to load all models, loading model1 should not affect model2
111111 tests := []string {"model2" , "model1" }
@@ -141,7 +141,7 @@ func TestProxyManager_SwapMultiProcessParallelRequests(t *testing.T) {
141141 })
142142
143143 proxy := New (config )
144- defer proxy .StopProcesses ()
144+ defer proxy .StopProcesses (StopWaitForInflightRequest )
145145
146146 results := map [string ]string {}
147147
@@ -352,7 +352,7 @@ func TestProxyManager_RunningEndpoint(t *testing.T) {
352352
353353 // Create proxy once for all tests
354354 proxy := New (config )
355- defer proxy .StopProcesses ()
355+ defer proxy .StopProcesses (StopWaitForInflightRequest )
356356
357357 t .Run ("no models loaded" , func (t * testing.T ) {
358358 req := httptest .NewRequest ("GET" , "/running" , nil )
@@ -407,7 +407,7 @@ func TestProxyManager_AudioTranscriptionHandler(t *testing.T) {
407407 })
408408
409409 proxy := New (config )
410- defer proxy .StopProcesses ()
410+ defer proxy .StopProcesses (StopWaitForInflightRequest )
411411
412412 // Create a buffer with multipart form data
413413 var b bytes.Buffer
@@ -461,7 +461,7 @@ func TestProxyManager_UseModelName(t *testing.T) {
461461 })
462462
463463 proxy := New (config )
464- defer proxy .StopProcesses ()
464+ defer proxy .StopProcesses (StopWaitForInflightRequest )
465465
466466 requestedModel := "model1"
467467
@@ -557,7 +557,7 @@ func TestProxyManager_CORSOptionsHandler(t *testing.T) {
557557 for _ , tt := range tests {
558558 t .Run (tt .name , func (t * testing.T ) {
559559 proxy := New (config )
560- defer proxy .StopProcesses ()
560+ defer proxy .StopProcesses (StopWaitForInflightRequest )
561561
562562 req := httptest .NewRequest (tt .method , "/v1/chat/completions" , nil )
563563 for k , v := range tt .requestHeaders {
@@ -586,7 +586,7 @@ func TestProxyManager_Upstream(t *testing.T) {
586586 })
587587
588588 proxy := New (config )
589- defer proxy .StopProcesses ()
589+ defer proxy .StopProcesses (StopWaitForInflightRequest )
590590 req := httptest .NewRequest ("GET" , "/upstream/model1/test" , nil )
591591 rec := httptest .NewRecorder ()
592592 proxy .ServeHTTP (rec , req )
@@ -604,7 +604,7 @@ func TestProxyManager_ChatContentLength(t *testing.T) {
604604 })
605605
606606 proxy := New (config )
607- defer proxy .StopProcesses ()
607+ defer proxy .StopProcesses (StopWaitForInflightRequest )
608608
609609 reqBody := fmt .Sprintf (`{"model":"%s", "x": "this is just some content to push the length out a bit"}` , "model1" )
610610 req := httptest .NewRequest ("POST" , "/v1/chat/completions" , bytes .NewBufferString (reqBody ))
0 commit comments