test/org-owners.test.ts, "the upgrade takes every agent out of Owners and records each in the outbox", fails about one run in three on main. It asserts that the migration's team.member_removed event has the newest id of all. But the test writes events in the same millisecond just before the migration runs, and within one millisecond two ULIDs order by their random part.
The invariant it means is that an outbox id is never older than the events before it. That should be held on the time the id carries (its first ten characters), not on the random part.
test/org-owners.test.ts, "the upgrade takes every agent out of Owners and records each in the outbox", fails about one run in three on main. It asserts that the migration'steam.member_removedevent has the newest id of all. But the test writes events in the same millisecond just before the migration runs, and within one millisecond two ULIDs order by their random part.The invariant it means is that an outbox id is never older than the events before it. That should be held on the time the id carries (its first ten characters), not on the random part.