The db tests get an echo server that honours the pull cursor, records
the filter of every pull, answers with a status of the test's choice
and keeps stale answers like the real one. New cases: a second user
opens without the collections, cursors, realtime subscriptions and
sync status of the first; wipeLocal really removes the cursors and the
database so that the next open pulls everything again; a push that
fails after a good pull and a pull that fails before the push both
keep the change records and the cursor, and the next round pushes it
all; a stale answer applies the server record and a newer local change
wins afterwards.
The stress test now compares every local record, tombstones included,
with the mock server after each round, so a divergence between the two
fails the test. closeDb() resets the last sync time for the same
reason: it belonged to the session that just ended.