57 tests in 7 groups

57 ways sync breaks, tested.

Each test will run on every mix of devices, hundreds of times a night with different timing, and end by checking what has to be true afterwards. How iCloud behaves in each one will be recorded from real iCloud on real devices, and recorded again on every iOS release. It's built first on Pikos, a notes, tasks and calendar app whose iCloud sync is in testing now.

The list is public on purpose. Give it to an agent and you get tests that agree with its own idea of iCloud; what makes these worth running is the simulated iCloud behind them, held to how the real one behaves.

Many devices

Not two test phones: every mix of devices a real user owns, making changes at once.

TestWhat must hold afterwards
Two to eight devices editing at onceEvery device ends with the same data
iPhone, iPad, Mac, Watch and Vision Pro togetherEach platform's quirks, like background limits, still converge
A device offline for a week, then backIt catches up, and sends what it held
A brand-new device joining an old accountIt downloads everything, and the time it takes is measured
Clocks that disagree by minutesThe order of edits comes from sync, not from a wrong clock
The app deleted and reinstalledEverything comes back from iCloud, and nothing is uploaded twice
A device restored from an old backupIts stale copy and change token are noticed, and it refetches instead of overwriting newer data
A device that hasn't opened the app in monthsIt catches up in full, and its old pending changes don't win over newer ones

Conflicts

The same data changed in two places before either heard about the other.

TestWhat must hold afterwards
Two devices edit the same recordBoth edits merge, field by field, and neither is silently lost
Two devices edit the same fieldOne rule decides the winner, the same way on every device
One device deletes what another editsDelete-or-keep is decided once, with no record coming back from the dead
Edits to an item that was moved or reorderedThe edit follows the item, and the order converges
A parent deleted while a child is addedNo orphan is left behind on any device
The same record created on two devices at onceOne record survives, not two, for things like a default list or a settings record
A number changed on two devices at onceBoth changes count, so neither device's change overwrites the other's
iCloud's copy changed since this device last saw itThe device merges the newer copy and saves again, instead of failing or overwriting it

Shared data and multiple users

A record shared with other people, who edit it from their own Apple IDs.

TestWhat must hold afterwards
Owner and participant edit the same shared noteBoth see both edits, from their own accounts
A participant's access is removed mid-editTheir pending change is refused, and their copy is removed
A participant leaves the shareThe owner keeps everything; the participant keeps nothing
A share accepted on a second deviceIt appears there too, without a duplicate
Read-only participants try to writeThe write is refused on the device, before iCloud refuses it
The owner deletes the shared recordIt disappears for every participant, and nobody's copy brings it back
Owner and participant on different app versionsNeither saves over fields the other's version doesn't know

Accounts

The Apple ID under the app changes, or stops being there.

TestWhat must hold afterwards
Signed out in the middle of a syncNothing is sent to the wrong account, and the app says why sync stopped
Another Apple ID signed inNothing merges across accounts
iCloud switched off for the appLocal data is kept, and sync resumes cleanly when it's back
Advanced Data Protection keys resetCKSyncEngineThe encrypted zone is rebuilt from what the devices hold
Data made before signing in to iCloudIt merges into the account once, with no duplicates
The first device on an account that has never used the appIts zone and subscription are created once, even when two devices start at the same moment
iCloud temporarily unavailable for the accountCKSyncEngineSync waits and says why, then resumes without losing anything
iCloud restricted by Screen Time or device managementCKSyncEngineThe app works locally and says sync is off, rather than failing quietly

Network and iCloud limits

iCloud refusing, slowing or losing the connection, the ways it does in production.

TestWhat must hold afterwards
iCloud fullCKSyncEngineNothing is dropped, and sending resumes when space returns
Rate limited, with a retry-afterCKSyncEngineNothing is sent before the retry-after
A batch partly failsCKSyncEngineOnly the failed records are retried
A batch too large to sendIt's split, and every record still arrives once
The network drops and returns, over and overNo change is lost, and none is sent twice
A record too big to save in one pieceIt's stored as an asset or chunks, and arrives whole
A save that timed out, though iCloud kept itCKSyncEngineThe retry doesn't make a duplicate
iCloud unavailable, with a retry-afterCKSyncEngineSending waits for the retry-after, then resumes
An asset upload cut off halfwayCKSyncEngineThe record isn't saved pointing at a missing file, and the upload is retried
A record arrives before its assetCKSyncEngineThe app shows it's still downloading, and never treats the file as lost

The app's own life

Things iOS and macOS do to an app while it's syncing.

TestWhat must hold afterwards
App killed mid-sendNo change is lost, and none is sent twice
Suspended in the background for hoursIt picks up where it left off
A silent push never arrivesThe next fetch catches up anyway
The device's own storage is fullSync pauses and says why, and nothing is half-written
A widget or extension writes while the app is closedThe change is sent the next time anything can send, and isn't lost or sent twice
Background App Refresh or Low Power Mode offThe app catches up when it opens, and says it was behind
Two windows of the app editing at onceBoth windows' changes are sent, in order, once
Woken in the background by a pushIt finishes in the time iOS allows, or saves where it stopped

Schema and app versions

Different versions of your app, and a schema in Production that can only grow.

TestWhat must hold afterwards
A field the build saves isn't in ProductionThe schema check fails the build before it ships
An old app version meets data from a new oneIt keeps what it doesn't understand, and saves nothing over it
A user skips three versionsTheir data migrates, step by step, with nothing lost
Change token expiredCKSyncEngineA full refetch, ending with the same data
A new install replays years of deletesIt converges, and the time it takes is measured
A zone deleted, purged or resetEach reason is handled, and nothing comes back from the dead
A field dropped from the model but still in ProductionOld versions can keep writing it without breaking new ones
A record type renamed in the modelOld records are carried over, not left behind under the old name

What works with what

The fast runs will swap your app's sync engine for a simulated iCloud inside one test process. CKSyncEngine, and libraries built on it like SQLiteData, can be swapped. SwiftData and Core Data run their sync inside Apple's framework, which can't be, so the tests where iCloud itself has to misbehave are marked CKSyncEngine above. The rest run on simulators against your development container, which is too slow for a pull request, so they will run nightly or on your Mac, and pull requests get the schema check.

CKSyncEngineSwiftData, Core Data
Schema check, inspector, compareyesyes
Devices, conflicts, sharing, accountsfast, in one processslower, on simulators
iCloud full, rate limits, expired tokensyesnot possible

How a run works

Simulated devices will make random edits through your app's own sync code, against a simulated iCloud that fails the way the real one does. Each run will have a seed, so any failure can be replayed exactly, step by step, in the inspector. A scripted check against your real staging container will catch what a simulation can't.

Want this for your app?

Two emails at most: when the free schema check ships, and when the app does.

Or explore the demo →