Files
usenet-indexer/tests/functional/catalog_space.spec.ts
Daan MeijerandClaude Opus 5.5 256fb24c46
Test and deploy / test (push) Successful in 54s
Test and deploy / edge (push) Successful in 2m3s
Test and deploy / deploy (push) Successful in 1m20s
A cap on the catalog's NVMe size: above it only the tail and the stored ranges
After reset 24 the catalog grew ~3.7 GB an hour (77 GB, root 31 GB free, 600k
history ranges to go). CATALOG_MAX_NVME_GB (as voyager 1's
BACKFILL_MAX_NVME_GB): once the default tablespace is over it, leases and the
prefetcher take priority < 0 only (the tail, the stored ranges); measured once
a minute. Off when unset; 90 on homelab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:10:11 +02:00

23 lines
820 B
TypeScript

import { test } from '@japa/runner'
import coordinatorConfig from '#config/coordinator'
test.group('CatalogSpace', () => {
test('is full over its cap, and off without one', async ({ assert }) => {
const before = coordinatorConfig.catalogMaxNvmeGb
try {
const { default: off } = await import('#services/catalog_space')
coordinatorConfig.catalogMaxNvmeGb = 0
assert.isFalse(await off.full())
// A fresh measurement with a cap far under any database's size.
;(off as any).checkedAt = 0
coordinatorConfig.catalogMaxNvmeGb = 0.000001
assert.isTrue(await off.full())
;(off as any).checkedAt = 0
coordinatorConfig.catalogMaxNvmeGb = 1_000_000
assert.isFalse(await off.full())
} finally {
coordinatorConfig.catalogMaxNvmeGb = before
}
})
})