mirror of
https://github.com/HeyPuter/puter.git
synced 2026-10-12 06:41:55 +00:00
The unit tests inject the driver error because sqlite has neither a read replica nor foreign-key enforcement, so neither half of this bug can occur locally — they prove the handling, not that the situation arises. This suite runs two MySQL servers in real replication and freezes the follower with STOP REPLICA, so the row really is gone on the primary and really is still served by the replica, and MySQL raises the foreign-key errors itself. Against the pre-fix code all four cases fail, including the unhandled "Cannot add or update a child row" the reported 500s were. Opt-in behind PUTER_TEST_REPLICA_LAG, matching the env-gated provider integration tests and their skipUnlessEnv helper, so CI and anyone without the containers skip it. It builds and drops its own database rather than touching local dev data.