The test was failing intermittently when run with -race flag due to a race condition between: 1. CertificateService constructor spawning a background goroutine that immediately queries the database 2. The test's HTTP request handler also querying the database On CI runners, the timing window is wider than on local machines, causing frequent failures. Solution: Add a 200ms sleep to allow the background goroutine to complete its initial sync before the test proceeds. This is acceptable in test code as it mirrors real-world usage where the service initializes before receiving HTTP requests. Fixes intermittent failure: Error: Not equal: expected: 200, actual: 500 no such table: ssl_certificates
Backend Service
This folder contains the Go API for CaddyProxyManager+.
Prerequisites
- Go 1.24+
Getting started
cp .env.example .env # optional
cd backend
go run ./cmd/api
Tests
cd backend
go test ./...