[folks] tests: Fix race condition in multi-store EDS tests
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] tests: Fix race condition in multi-store EDS tests
- Date: Mon, 9 Mar 2015 16:21:42 +0000 (UTC)
commit 177528b0ad3ad51d103f77eb0c246c5699760f01
Author: Philip Withnall <philip withnall collabora co uk>
Date: Mon Mar 9 16:14:26 2015 +0000
tests: Fix race condition in multi-store EDS tests
If a single EDS test used multiple persona stores (i.e. address books,
each of which is a single ESource), it was possible for creation of the
ESources to race so that the ESourceRegistry notified of creation of the
sources in a different order from the calls to Eds.Backend.set_up().
This caused Eds.Backend.set_up() to return prematurely for some of the
persona stores, causing failures later on.
Check the UID of ESources which have been signalled as created to ensure
the correct one is chosen for each set_up() call.
tests/lib/eds/backend.vala | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/tests/lib/eds/backend.vala b/tests/lib/eds/backend.vala
index a39e59e..7ec57b5 100644
--- a/tests/lib/eds/backend.vala
+++ b/tests/lib/eds/backend.vala
@@ -163,6 +163,9 @@ public class EdsTest.Backend
this._source_registry = source_registry;
var signal_id = source_registry.source_added.connect ((r, s) =>
{
+ if (s.uid != this._addressbook_name)
+ return;
+
this._source = s;
this._prepare_source_async.callback ();
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]