mirror of
https://github.com/portainer/portainer.git
synced 2025-11-26 14:06:05 +08:00
fix(tests): fix data races EE-6867 (#11387)
This commit is contained in:
@@ -138,13 +138,14 @@ func agentServer(t *testing.T) string {
|
||||
Handler: h,
|
||||
}
|
||||
|
||||
errCh := make(chan error)
|
||||
go func() {
|
||||
err := s.Serve(l)
|
||||
require.ErrorIs(t, err, http.ErrServerClosed)
|
||||
errCh <- s.Serve(l)
|
||||
}()
|
||||
|
||||
t.Cleanup(func() {
|
||||
s.Shutdown(context.Background())
|
||||
require.NoError(t, s.Shutdown(context.Background()))
|
||||
require.ErrorIs(t, <-errCh, http.ErrServerClosed)
|
||||
})
|
||||
|
||||
return "http://" + l.Addr().String()
|
||||
|
||||
Reference in New Issue
Block a user