All checks were successful
release-tag / release-image (push) Successful in 2m43s
17 lines
517 B
Go
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")
|
|
}
|
|
}
|