[#215] container/tests: add tests for container size estimation

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-17 13:51:11 +03:00 committed by Alex Vanin
parent 53f102344f
commit 7bca6bf782
3 changed files with 147 additions and 21 deletions

View file

@ -61,7 +61,8 @@ const (
estimateKeyPrefix = "cnr"
estimatePostfixSize = 10
cleanupDelta = 3
// CleanupDelta contains number last epochs for which container estimations are present.
CleanupDelta = 3
// NotFoundError is returned if container is missing.
NotFoundError = "container does not exist"
@ -780,7 +781,7 @@ func cleanupContainers(ctx storage.Context, epoch int) {
var n interface{} = nbytes
if epoch-n.(int) > cleanupDelta {
if epoch-n.(int) > CleanupDelta {
storage.Delete(ctx, k)
}
}