Skip to content

Commit 5a295c5

Browse files
committed
fix(internal/orchestrion/_integration/valyala_fasthttp): improve handlin for ListenAndServe
1 parent ac2cd84 commit 5a295c5

File tree

1 file changed

+3
-1
lines changed
  • internal/orchestrion/_integration/valyala_fasthttp

1 file changed

+3
-1
lines changed

internal/orchestrion/_integration/valyala_fasthttp/fasthttp.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ func (tc *TestCase) Setup(_ context.Context, t *testing.T) {
3737
tc.Server = &fasthttp.Server{Handler: fastHTTPHandler}
3838
tc.Addr = fmt.Sprintf("127.0.0.1:%d", net.FreePort(t))
3939

40-
go func() { assert.ErrorIs(t, tc.Server.ListenAndServe(tc.Addr), http.ErrServerClosed) }()
40+
// Note: fasthttp.Server.ListenAndServe returns nil on graceful shutdown,
41+
// not http.ErrServerClosed like net/http does.
42+
go func() { _ = tc.Server.ListenAndServe(tc.Addr) }()
4143
t.Cleanup(func() {
4244
// Using a new 10s-timeout context, as we may be running cleanup after the original context expired.
4345
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)

0 commit comments

Comments
 (0)