evolution-data-server/SOURCES/evolution-data-server-3.28.5-tests-cal-client-get-revision.patch
2021-09-09 16:26:55 +00:00

101 lines
5.5 KiB
Diff

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