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

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