This commit is contained in:
wiggin77
2025-05-25 00:06:14 -04:00
parent cc88b959fb
commit b244db94e2
2 changed files with 14 additions and 2 deletions

View File

@@ -25,6 +25,11 @@ build:
test:
go test ./...
# Run tests with race condition detection
.PHONY: test-race
test-race:
go test -race ./...
# Build for all supported architectures
.PHONY: buildall
buildall: clean
@@ -78,6 +83,7 @@ help:
@echo " build - Build for current architecture"
@echo " buildall - Build for all supported architectures"
@echo " test - Run tests"
@echo " test-race - Run tests with race condition detection"
@echo " check-style - Install golangci-lint and run code style checks"
@echo " clean - Remove build artifacts"
@echo " run - Build and run the application"

View File

@@ -165,10 +165,10 @@ func (s *MockSMTPServer) Reset() {
}
func (s *MockSMTPServer) acceptConnections() {
for s.running {
for s.isRunning() {
conn, err := s.listener.Accept()
if err != nil {
if s.running {
if s.isRunning() {
fmt.Printf("Accept error: %v\n", err)
}
continue
@@ -178,6 +178,12 @@ func (s *MockSMTPServer) acceptConnections() {
}
}
func (s *MockSMTPServer) isRunning() bool {
s.mu.Lock()
defer s.mu.Unlock()
return s.running
}
func (s *MockSMTPServer) handleConnection(conn net.Conn) {
defer conn.Close()