diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2013-07-31 09:08:42 +0200 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2013-07-31 09:08:42 +0200 |
commit | 2bbfff087d22b507bb6100977cc72ab583f39d73 (patch) | |
tree | ca420ea3495f0f85ab9dd88de5d65b542af037a9 | |
parent | 125f3f1054ef9562e28bc5d74bd565058e1baacc (diff) | |
download | libgdata-2bbfff087d22b507bb6100977cc72ab583f39d73.tar.gz |
tests: Work around distributed system bugs in the Google Contacts servers
Looks like the servers have changed to use weak synchronisation of new
contacts, so querying for contacts immediately after adding them now
often won’t return the new ones, or will return them with outdated IDs.
‘Fix’ this by adding a mandatory sleep after creating the contacts, and
before querying them for the first time.
-rw-r--r-- | gdata/tests/contacts.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdata/tests/contacts.c b/gdata/tests/contacts.c index c9afdcd7..1148e494 100644 --- a/gdata/tests/contacts.c +++ b/gdata/tests/contacts.c @@ -179,6 +179,12 @@ set_up_query_all_contacts (QueryAllContactsData *data, gconstpointer service) g_object_unref (contact); gdata_mock_server_end_trace (mock_server); + + /* It takes a few seconds for the contacts to reliably propagate around Google's servers. Distributed systems are so fun. Not. + * Thankfully, we don't have to wait when running against the mock server. */ + if (gdata_mock_server_get_enable_online (mock_server) == TRUE) { + g_usleep (G_USEC_PER_SEC * 5); + } } static void |