diff options
author | William Hua <william.hua@canonical.com> | 2013-08-12 02:12:07 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-08-12 02:12:07 +0000 |
commit | b95b1793605426da03ca61d3c825c93bd9eaf64e (patch) | |
tree | ec407054fa0ec3ff4661055184a15a30b618fc60 /tests | |
parent | 0e3bb46532e1858f2cfee808bd66efa225cb2d94 (diff) | |
parent | 5c12e10be77351e88b6c550894e4ca34c99aacf8 (diff) | |
download | ayatana-indicator-keyboard-b95b1793605426da03ca61d3c825c93bd9eaf64e.tar.gz ayatana-indicator-keyboard-b95b1793605426da03ca61d3c825c93bd9eaf64e.tar.bz2 ayatana-indicator-keyboard-b95b1793605426da03ca61d3c825c93bd9eaf64e.zip |
Resolve flaky test by always forcing the delay.
The test used to kill a delay as soon as a change was observed on the action group which was activated. On slower systems, this caused an assertion failure because updating the dconf setting took much longer than getting the change notification.
Approved by PS Jenkins bot, Mathieu Trudel-Lapierre.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.vala | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/main.vala b/tests/main.vala index d9d52733..6bbcc61a 100644 --- a/tests/main.vala +++ b/tests/main.vala @@ -150,18 +150,12 @@ static void test_activate_input_source (void *data) { var action_group = DBusActionGroup.get ((!) fixture.connection, "com.canonical.indicator.keyboard", "/com/canonical/indicator/keyboard"); - var loop = new MainLoop (null, false); - var signal_name = action_group.action_state_changed["current"].connect ((action, state) => { - loop.quit (); - }); - action_group.list_actions (); action_group.activate_action ("current", new Variant.uint32 (2)); - var source = Timeout.add_seconds (TIMEOUT_S, () => { loop.quit (); return false; }); + var loop = new MainLoop (null, false); + Timeout.add_seconds (TIMEOUT_S, () => { loop.quit (); return false; }); loop.run (); - Source.remove (source); - action_group.disconnect (signal_name); var state = action_group.get_action_state ("current"); var current = state.get_uint32 (); @@ -325,6 +319,10 @@ static void test_migration (void *data) { return; } + var loop = new MainLoop (null, false); + Timeout.add_seconds (TIMEOUT_S, () => { loop.quit (); return false; }); + loop.run (); + try { string sources; Process.spawn_command_line_sync ("gsettings get org.gnome.desktop.input-sources sources", out sources); @@ -387,6 +385,10 @@ static void test_no_migration (void *data) { return; } + var loop = new MainLoop (null, false); + Timeout.add_seconds (TIMEOUT_S, () => { loop.quit (); return false; }); + loop.run (); + try { string sources; Process.spawn_command_line_sync ("gsettings get org.gnome.desktop.input-sources sources", out sources); |