forked from Silverfish/proton-bridge
feat(GODT-2538): implement smart picking of default IMAP/SMTP ports
This commit is contained in:
@ -20,6 +20,7 @@ package tests
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/smtp"
|
||||
"net/url"
|
||||
"regexp"
|
||||
@ -160,6 +161,9 @@ type testCtx struct {
|
||||
// errors holds test-related errors encountered while running test steps.
|
||||
errors [][]error
|
||||
errorsLock sync.RWMutex
|
||||
|
||||
// This slice contains the dummy listeners that are intended to block network ports.
|
||||
dummyListeners []net.Listener
|
||||
}
|
||||
|
||||
type imapClient struct {
|
||||
@ -437,6 +441,12 @@ func (t *testCtx) close(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
for _, listener := range t.dummyListeners {
|
||||
if err := listener.Close(); err != nil {
|
||||
logrus.WithError(err).Errorf("Failed to close dummy listener %v", listener.Addr())
|
||||
}
|
||||
}
|
||||
|
||||
t.api.Close()
|
||||
t.events.close()
|
||||
t.reporter.close()
|
||||
|
||||
Reference in New Issue
Block a user