mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-11-10 22:50:59 +08:00
A per-run key space stops concurrent runs from deleting each other's objects, but it also means nothing ever revisits the keys of a run that was killed before its cleanup, so those leak forever. The fixed prefix this replaced at least swept itself on the next run. The first test to construct an s3 store now sweeps the shared test root once per binary, deleting anything older than two hours: a test takes seconds and a CI job minutes, so nothing that old can belong to a live run. Failures to list or delete are logged, not fatal, since this is hygiene and not the test. The age filter is a pure function with its own tests, including that an object whose modification time could not be read is left alone rather than treated as infinitely old. This is a backstop. A lifecycle rule on the bucket (expire testpkg-* after a day) is the real fix, since it also covers a bucket nobody runs tests against for a while and cannot be skipped by a crash.