feat(tests): enhance integration tests for CrowdSec and Coraza, improve error handling and logging
- Updated `coraza_integration_test.go` and `crowdsec_integration_test.go` for better logging and error handling. - Added `ttlRemainingSeconds` to `CrowdsecHandler` to provide remaining TTL in responses. - Improved error messages in `ApplyPreset` and `GetCachedPreset` methods for better user guidance. - Enhanced test coverage for applying presets, including scenarios for cache misses and expired caches. - Introduced new tests for cache refresh logic and ensured proper rollback behavior during failures. - Updated QA report with recent testing outcomes and observations.
This commit is contained in:
@@ -51,7 +51,7 @@ func Connect(dbPath string) (*gorm.DB, error) {
|
||||
func configurePool(sqlDB *sql.DB) {
|
||||
// SQLite is file-based, so we limit connections
|
||||
// but keep some idle for reuse
|
||||
sqlDB.SetMaxOpenConns(1) // SQLite only allows one writer at a time
|
||||
sqlDB.SetMaxIdleConns(1) // Keep one connection ready
|
||||
sqlDB.SetMaxOpenConns(1) // SQLite only allows one writer at a time
|
||||
sqlDB.SetMaxIdleConns(1) // Keep one connection ready
|
||||
sqlDB.SetConnMaxLifetime(0) // Don't close idle connections
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user