[folks] tests: Manually iterate main context on tear_down in Dummy tests



commit 12b7985e8f28e66420ec522cb5fcb621e8e07a78
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Mon Apr 7 09:38:36 2014 -0700

    tests: Manually iterate main context on tear_down in Dummy tests
    
    The code under test in these cases doesn’t (yet) correctly ensure there
    are no pending events before returning. To avoid assertion failure,
    manually iterate the global default main context until all pending
    events have been handled, then continue to tear_down.
    
    In future, it would be better to fix the tests and backends themselves
    to not leak main context events after unprepare() has been called.
    See https://bugzilla.gnome.org/show_bug.cgi?id=727700.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726973

 tests/lib/dummy/test-case.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/tests/lib/dummy/test-case.vala b/tests/lib/dummy/test-case.vala
index 4379677..ccf5b45 100644
--- a/tests/lib/dummy/test-case.vala
+++ b/tests/lib/dummy/test-case.vala
@@ -144,7 +144,9 @@ public class DummyTest.TestCase : Folks.TestCase
       /* Ensure that all pending operations are complete.
        *
        * FIXME: This should be eliminated and unprepare() should guarantee there
-       * are no more pending Backend/PersonaStore events. */
+       * are no more pending Backend/PersonaStore events.
+       *
+       * https://bugzilla.gnome.org/show_bug.cgi?id=727700 */
       var context = MainContext.default ();
       while (context.iteration (false));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]