At ~200 articles/s what the prober stores (inspections, par2 file lists, the WAL) took ~0.8-1.1 GB an hour of homelab's root, and nothing stopped it at the 10 GB floor. Below 12 GB free it claims nothing (resumed 1 GB above): the lanes go dry and its share shrinks to its minimum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
815 B
TypeScript
23 lines
815 B
TypeScript
import { test } from '@japa/runner'
|
|
import { DiskSpace } from '#services/disk_space'
|
|
|
|
test.group('DiskSpace', () => {
|
|
test('short below the floor, fine again a margin above it; off without a floor', async ({ assert }) => {
|
|
let gb = 15
|
|
const space = new DiskSpace('probing', '/', 12, async () => gb * 1e9, 0)
|
|
assert.isFalse(await space.short())
|
|
gb = 11.5
|
|
assert.isTrue(await space.short())
|
|
// Back over the floor, not yet over the margin: still short.
|
|
gb = 12.5
|
|
assert.isTrue(await space.short())
|
|
gb = 13.1
|
|
assert.isFalse(await space.short())
|
|
assert.isFalse(await new DiskSpace('probing', '/', 0, async () => 0, 0).short())
|
|
})
|
|
|
|
test('measures a real filesystem', async ({ assert }) => {
|
|
assert.isFalse(await new DiskSpace('probing', '/', 0.001).short())
|
|
})
|
|
})
|