Blame SOURCES/evolution-data-server-3.28.5-tests-cal-client-get-revision.patch

f0a9c3
diff -up evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c.test-cal-client-get-revision evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c
f0a9c3
--- evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c.test-cal-client-get-revision	2018-07-30 15:17:06.000000000 +0200
f0a9c3
+++ evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c	2019-05-23 19:31:07.484064234 +0200
f0a9c3
@@ -1856,6 +1856,12 @@ e_data_book_report_backend_property_chan
f0a9c3
 		g_strfreev (strv);
f0a9c3
 	}
f0a9c3
 
f0a9c3
+	/* Ensure the property change signal on the D-Bus is invoked immediately, not on idle */
f0a9c3
+	g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (dbus_interface));
f0a9c3
+
f0a9c3
+	if (book->priv->connection && !g_dbus_connection_is_closed (book->priv->connection))
f0a9c3
+		g_dbus_connection_flush_sync (book->priv->connection, NULL, NULL);
f0a9c3
+
f0a9c3
 	/* Disregard anything else. */
f0a9c3
 }
f0a9c3
 
f0a9c3
diff -up evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c.test-cal-client-get-revision evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c
f0a9c3
--- evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c.test-cal-client-get-revision	2018-07-30 15:17:06.000000000 +0200
f0a9c3
+++ evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c	2019-05-23 19:31:07.485064234 +0200
f0a9c3
@@ -2470,6 +2470,12 @@ e_data_cal_report_backend_property_chang
f0a9c3
 	if (g_str_equal (prop_name, CAL_BACKEND_PROPERTY_DEFAULT_OBJECT))
f0a9c3
 		e_dbus_calendar_set_default_object (dbus_interface, prop_value);
f0a9c3
 
f0a9c3
+	/* Ensure the property change signal on the D-Bus is invoked immediately, not on idle */
f0a9c3
+	g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (dbus_interface));
f0a9c3
+
f0a9c3
+	if (cal->priv->connection && !g_dbus_connection_is_closed (cal->priv->connection))
f0a9c3
+		g_dbus_connection_flush_sync (cal->priv->connection, NULL, NULL);
f0a9c3
+
f0a9c3
 	/* Disregard anything else. */
f0a9c3
 }
f0a9c3
 
f0a9c3
diff -up evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c.test-cal-client-get-revision evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c
f0a9c3
--- evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c.test-cal-client-get-revision	2018-07-30 15:17:06.000000000 +0200
f0a9c3
+++ evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c	2019-05-23 19:31:07.485064234 +0200
f0a9c3
@@ -48,9 +48,22 @@ get_revision_compare_cycle (EBookClient
f0a9c3
 	if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
f0a9c3
 		g_error ("Error getting book revision: %s", error->message);
f0a9c3
 
f0a9c3
+	/* Sometimes, kind of rarely, the D-Bus property change is not delivered on time,
f0a9c3
+	   thus give it some time to be received and processed. */
f0a9c3
+	if (g_strcmp0 (revision_before, revision_after) == 0) {
f0a9c3
+		g_message ("   D-Bus property 'revision' change not received yet, trying to wait a bit");
f0a9c3
+
f0a9c3
+		g_usleep (G_USEC_PER_SEC / 2);
f0a9c3
+
f0a9c3
+		g_clear_pointer (&revision_after, g_free);
f0a9c3
+
f0a9c3
+		if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
f0a9c3
+			g_error ("Error getting book revision: %s", error->message);
f0a9c3
+	}
f0a9c3
+
f0a9c3
 	g_assert (revision_before);
f0a9c3
 	g_assert (revision_after);
f0a9c3
-	g_assert (strcmp (revision_before, revision_after) != 0);
f0a9c3
+	g_assert_cmpstr (revision_before, !=, revision_after);
f0a9c3
 
f0a9c3
 	g_message (
f0a9c3
 		"Passed cycle, revision before '%s' revision after '%s'",
f0a9c3
diff -up evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c.test-cal-client-get-revision evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c
f0a9c3
--- evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c.test-cal-client-get-revision	2018-07-30 15:17:06.000000000 +0200
f0a9c3
+++ evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c	2019-05-23 19:31:07.485064234 +0200
f0a9c3
@@ -42,18 +42,34 @@ get_revision_compare_cycle (ECalClient *
f0a9c3
 
f0a9c3
 	if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
f0a9c3
 						&revision_before, NULL, &error))
f0a9c3
-		g_error ("Error getting book revision: %s", error->message);
f0a9c3
+		g_error ("Error getting calendar revision: %s", error->message);
f0a9c3
 
f0a9c3
 	if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, &error))
f0a9c3
 		g_error ("Error creating object: %s", error->message);
f0a9c3
 
f0a9c3
+	if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
f0a9c3
+		g_error ("Error removing created object: %s", error->message);
f0a9c3
+
f0a9c3
 	if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
f0a9c3
 						&revision_after, NULL, &error))
f0a9c3
-		g_error ("Error getting book revision: %s", error->message);
f0a9c3
+		g_error ("Error getting calendar revision: %s", error->message);
f0a9c3
+
f0a9c3
+	/* Sometimes, kind of rarely, the D-Bus property change is not delivered on time,
f0a9c3
+	   thus give it some time to be received and processed. */
f0a9c3
+	if (g_strcmp0 (revision_before, revision_after) == 0) {
f0a9c3
+		g_message ("   D-Bus property 'revision' change not received yet, trying to wait a bit");
f0a9c3
+
f0a9c3
+		g_usleep (G_USEC_PER_SEC / 2);
f0a9c3
+
f0a9c3
+		g_clear_pointer (&revision_after, g_free);
f0a9c3
+
f0a9c3
+		if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
f0a9c3
+			g_error ("Error getting book revision: %s", error->message);
f0a9c3
+	}
f0a9c3
 
f0a9c3
 	g_assert (revision_before);
f0a9c3
 	g_assert (revision_after);
f0a9c3
-	g_assert (strcmp (revision_before, revision_after) != 0);
f0a9c3
+	g_assert_cmpstr (revision_before, !=, revision_after);
f0a9c3
 
f0a9c3
 	g_message (
f0a9c3
 		"Passed cycle, revision before '%s' revision after '%s'",