summaryrefslogtreecommitdiff
path: root/src/libebackend
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2018-10-17 17:19:16 +0200
committerMilan Crha <mcrha@redhat.com>2018-10-17 17:19:16 +0200
commitaaa174787eea3a10dd26feeba21683963e7bb172 (patch)
tree376667926b35f7546c37b4bfcd78df26d87cb313 /src/libebackend
parentf4b58bc962a4f0b6fc5e9f607d6de21df460f4a1 (diff)
downloadevolution-data-server-aaa174787eea3a10dd26feeba21683963e7bb172.tar.gz
Make tests retry when factory doesn't know about added ESource yet
When the test creates a new ESource and saves it, then it waits for an "source-added" signal on an ESourceRegistry instance to know that it had been "registered" in the registry. It could sometimes happen that the client received this signal before the factory, which means that trying to open this ESource fails with a NOT_FOUND error due to the factory's ESourceRegistry instance wasn't updated yet. This change tries again for three times with a one second delay, which should be enough to have the factory's list of known sources updated.
Diffstat (limited to 'src/libebackend')
-rw-r--r--src/libebackend/e-data-factory.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libebackend/e-data-factory.c b/src/libebackend/e-data-factory.c
index 130b2bb62..15a5249d7 100644
--- a/src/libebackend/e-data-factory.c
+++ b/src/libebackend/e-data-factory.c
@@ -1342,6 +1342,13 @@ data_factory_spawn_subprocess_backend (EDataFactory *data_factory,
priv = data_factory->priv;
source = e_source_registry_ref_source (priv->registry, uid);
+
+ if (!source) {
+ g_set_error (
+ &error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ _("No such source for UID “%s”"), uid);
+ }
+
if (source && e_source_has_extension (source, extension_name)) {
ESourceBackend *extension;
@@ -1487,7 +1494,7 @@ data_factory_spawn_subprocess_backend (EDataFactory *data_factory,
NULL);
g_object_unref (subprocess);
- } else {
+ } else if (!error) {
error = g_error_new (G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Backend factory for source “%s” and extension “%s” cannot be found."),
uid, extension_name);