Skip to content

Commit eccd426

Browse files
author
Niklas Burchhardt
committed
test: remove TestApi/Listen to resolve 500 errors in test suite
Sending SIGTERM to the global process ID during a parallel test run was killing other concurrent subtests, leading to race conditions and 500 Internal Server Errors in the webhook tests. Removed the test to restore suite stability, as it mostly tested Fiber's internal shutdown mechanics.
1 parent 59ec3cf commit eccd426

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

pkg/api/api_test.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ package api_test
33
import (
44
"net/http"
55
"net/http/httptest"
6-
"os"
7-
"syscall"
86
"testing"
9-
"time"
107

118
"github.com/stretchr/testify/assert"
129
"go.uber.org/mock/gomock"
@@ -37,20 +34,4 @@ func TestApi(t *testing.T) {
3734
assert.NoError(t, err)
3835
assert.Equal(t, http.StatusOK, resp.StatusCode)
3936
})
40-
41-
t.Run("Listen", func(t *testing.T) {
42-
t.Parallel()
43-
44-
go func() {
45-
err := app.Listen("5000")
46-
assert.NoError(t, err)
47-
}()
48-
49-
time.Sleep(time.Second) // Allow server to start
50-
51-
// Simulate SIGTERM signal to trigger shutdown
52-
process, _ := os.FindProcess(os.Getpid())
53-
err := process.Signal(syscall.SIGTERM)
54-
assert.NoError(t, err)
55-
})
5637
}

0 commit comments

Comments
 (0)