[pygobject] tests: Remove TestMainLoop.test_concurrency



commit ab574b6c40b6e58f396c9522be864a78478617c1
Author: Christoph Reiter <creiter src gnome org>
Date:   Tue Mar 21 12:43:33 2017 +0100

    tests: Remove TestMainLoop.test_concurrency
    
    The code containing the bug no longer exists and the test doesn't do
    what it says. The thread never gets terminated and it doesn't
    assert anything. And I'm not sure what it should assert.
    
    For the corresponding bug see
        https://bugzilla.gnome.org/show_bug.cgi?id=663068
    
    While the test doesn't hurt, it adds half a second wait time
    to the test suite.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698548

 tests/test_mainloop.py |   27 ---------------------------
 1 files changed, 0 insertions(+), 27 deletions(-)
---
diff --git a/tests/test_mainloop.py b/tests/test_mainloop.py
index 2728e09..5a90387 100644
--- a/tests/test_mainloop.py
+++ b/tests/test_mainloop.py
@@ -7,12 +7,6 @@ import signal
 import time
 import unittest
 
-try:
-    from _thread import start_new_thread
-    start_new_thread  # pyflakes
-except ImportError:
-    # Python 2
-    from thread import start_new_thread
 from gi.repository import GLib
 
 from compathelper import _bytes
@@ -62,27 +56,6 @@ class TestMainLoop(unittest.TestCase):
         #
         self.assertFalse(got_exception)
 
-    @unittest.skipUnless(hasattr(signal, "SIGUSR1"), "no SIGUSR1")
-    def test_concurrency(self):
-        def on_usr1(signum, frame):
-            pass
-
-        try:
-            # create a thread which will terminate upon SIGUSR1 by way of
-            # interrupting sleep()
-            orig_handler = signal.signal(signal.SIGUSR1, on_usr1)
-            start_new_thread(time.sleep, (10,))
-
-            # now create two main loops
-            loop1 = GLib.MainLoop()
-            loop2 = GLib.MainLoop()
-            GLib.timeout_add(100, lambda: os.kill(os.getpid(), signal.SIGUSR1))
-            GLib.timeout_add(500, loop1.quit)
-            loop1.run()
-            loop2.quit()
-        finally:
-            signal.signal(signal.SIGUSR1, orig_handler)
-
     @unittest.skipUnless(hasattr(os, "fork"), "no os.fork available")
     def test_sigint(self):
         pid = os.fork()


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