Bug#992787: release.debian.org: state/autopkgtest-results.cache keeps on growing
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: britney
I'm filing this bug to remind myself (and others) that britney never
cleans up its autopkgtest-results.cache file. Today I used an
out-of-band script to reduce the file a bit (from 529M to 50M), but
britney should do that somehow by itself.
As far as I understand, this isn't so much an issue for Ubuntu because
they start over again with each release. IIRC we could do that as well
as it would be just a bit more churn at the start of the release, so
it's probably smarter to drop results of versions that don't exist
anymore in the involved suites.
Paul
-rw-rw-r-- 1 release debian-release 50M aug 23 11:10 autopkgtest-results.cache
-rw-rw-r-- 1 release debian-release 529M aug 23 10:13 autopkgtest-results.cache.old
(Ugly) Code used
elbrus@respighi:~$ cat bin/strip-britney-autopkgtest.cache
#!/usr/bin/python3
import json
import time
from copy import deepcopy
ref_time = round(time.time()) - 150 * 86000
with open('/home/release/britney/state/autopkgtest-results.cache') as f:
test_results = json.load(f)
test_results_new = deepcopy(test_results)
for (trigger, trigger_data) in test_results.items():
for (src, results) in trigger_data.items():
for (arch, result) in results.items():
if result[3] < ref_time:
del test_results_new[trigger][src][arch]
if len(test_results_new[trigger][src]) == 0:
del test_results_new[trigger][src]
if len(test_results_new[trigger]) == 0:
del test_results_new[trigger]
with open('/home/elbrus/autopkgtest-results.cache.new', 'w') as f:
json.dump(test_results_new, f, indent=2)
Reply to: