Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/testutils/restartable_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func (l *RestartableListener) Addr() net.Addr {
// Stop closes existing connections on the listener and prevents new connections
// from being accepted.
func (l *RestartableListener) Stop() {
logger.Infof("Stopping restartable listener %q", l.Addr())

l.mu.Lock()
l.stopped = true
for _, conn := range l.conns {
Expand All @@ -92,6 +94,8 @@ func (l *RestartableListener) Stop() {

// Restart gets a previously stopped listener to start accepting connections.
func (l *RestartableListener) Restart() {
logger.Infof("Restarting listener %q", l.Addr())

l.mu.Lock()
l.stopped = false
l.mu.Unlock()
Expand Down