Files
glpi-neural-brain/internal/graph/sqlite_checkpoint_policy_test.go
jbergner 440423c5b6
All checks were successful
release-tag / release-image (push) Successful in 2m43s
RC-3
2026-08-09 11:29:13 +02:00

17 lines
517 B
Go

package graph
import "testing"
func TestWALCheckpointNeededOnlyForLargeCleanWAL(t *testing.T) {
const threshold int64 = 128 << 20
if walCheckpointNeeded(true, threshold*2, threshold) {
t.Fatal("dirty graphs must not trigger a truncating WAL checkpoint")
}
if walCheckpointNeeded(false, threshold-1, threshold) {
t.Fatal("small WAL files must not trigger a truncating checkpoint")
}
if !walCheckpointNeeded(false, threshold, threshold) {
t.Fatal("a clean WAL at the threshold must be checkpointed")
}
}