Quiet first week on a new server: background 100 an hour, no collections or evidence reads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,4 +45,17 @@ class SafetyLimitsTest {
|
||||
// The rest begins exactly ten minutes after the last press (plus the same small margin as a programme's end).
|
||||
assertEquals(GUIDE_PICTURE_REST_MS + 50, programmeEndDelayMs(1_000L + GUIDE_PICTURE_REST_MS, 1_000L))
|
||||
}
|
||||
|
||||
@Test fun aNewServerGetsAQuietFirstWeek() {
|
||||
val root = kotlin.io.path.createTempDirectory("quiet").toFile()
|
||||
val w = ServerWorkspace("http://example.test", root, root, "alias", original = false)
|
||||
assertTrue(w.quietStart(now)) // first use starts the clock
|
||||
assertTrue(w.quietStart(now + 6 * 24 * 60 * 60_000L))
|
||||
assertFalse(w.quietStart(now + QUIET_START_MS))
|
||||
// The budget in force is what the limiter keeps to.
|
||||
BackgroundPacing.budget = QUIET_START_BUDGET
|
||||
var made = 0
|
||||
while (background()) made++
|
||||
assertEquals(100, made)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user