[libgdata] tests: Work around distributed system bugs in the Google Contacts servers



commit a1d2ad38ff2dca93ab763fb50ed3c1f9c35848f8
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Jul 31 09:08:42 2013 +0200

    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.

 gdata/tests/contacts.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gdata/tests/contacts.c b/gdata/tests/contacts.c
index 710851c..a3d947a 100644
--- a/gdata/tests/contacts.c
+++ b/gdata/tests/contacts.c
@@ -161,6 +161,9 @@ set_up_query_all_contacts (QueryAllContactsData *data, gconstpointer service)
        gdata_contacts_contact_set_nickname (contact, "Test Contact 3");
        data->contact3 = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, 
NULL, NULL);
        g_object_unref (contact);
+
+       /* It takes a few seconds for the contacts to reliably propagate around Google's servers. Distributed 
systems are so fun. Not. */
+       g_usleep (G_USEC_PER_SEC * 5);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]