Tests: the arrived entries' hashes sort before the registered one's, so a writer that ignores the tiers picks the arrived one

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 10:16:53 +02:00
commit acbf031c5b
2 changed files with 4 additions and 4 deletions

View file

@ -341,8 +341,8 @@ class CultCacheTests(unittest.TestCase):
def test_a_registered_entry_is_written_as_it_is_over_the_arrived_entries_with_the_same_own_id_in_either_order(self) -> None:
import msgpack # type: ignore
stale1 = self._writer_entry("tests.x", "tests.n", "stale-1", ("tests.x", "old"))
stale2 = self._writer_entry("tests.x", "tests.n", "stale-2", ("tests.x",))
stale1 = self._writer_entry("tests.x", "tests.n", "a-stale-1", ("tests.x", "old"))
stale2 = self._writer_entry("tests.x", "tests.n", "a-stale-2", ("tests.x",))
registered = self._writer_record("a", "tests.n", "tests.x", self._writer_entry("tests.x", "tests.n", "fresh", ("tests.x",)))
for entries in ([stale1, stale2], [stale2, stale1]):
with tempfile.TemporaryDirectory() as tmp:

View file

@ -1377,8 +1377,8 @@ const catalogOf = async (file: string): Promise<unknown[][]> =>
test("a registered entry is written as it is, over the arrived entries with the same own id, in either order", async () => {
const dir = await mkdtemp(join(tmpdir(), "cultcache-registered-wins-"));
const stale1 = writerEntry("tests.x", "tests.n", "stale-1", ["tests.x", "old"]);
const stale2 = writerEntry("tests.x", "tests.n", "stale-2", ["tests.x"]);
const stale1 = writerEntry("tests.x", "tests.n", "a-stale-1", ["tests.x", "old"]);
const stale2 = writerEntry("tests.x", "tests.n", "a-stale-2", ["tests.x"]);
const registered = writerRecord("a", "tests.n", "tests.x", writerEntry("tests.x", "tests.n", "fresh", ["tests.x"]));
for (const [name, entries] of [["12", [stale1, stale2]], ["21", [stale2, stale1]]] as const) {