Przeglądaj źródła

Windows test fixes

Ask Solem 9 lat temu
rodzic
commit
bf9756f17a

+ 5 - 1
celery/concurrency/asynpool.py

@@ -428,6 +428,7 @@ class AsynPool(_pool.Pool):
 
     def _event_process_exit(self, hub, fd):
         # This method is called whenever the process sentinel is readable.
+        print('>>> HUB REMOVE PROCESS: %r'  %(fd,))
         hub.remove(fd)
         self.maintain_pool()
 
@@ -614,6 +615,7 @@ class AsynPool(_pool.Pool):
             remove_reader(proc.sentinel)
             waiting_to_start.discard(proc)
             self._active_writes.discard(proc.inqW_fd)
+            print('>>> REMOVE WRITER: %r' % (proc.inqW_fd,))
             remove_writer(proc.inqW_fd)
             remove_reader(proc.outqR_fd)
             if proc.synqR_fd:
@@ -694,7 +696,9 @@ class AsynPool(_pool.Pool):
                     [hub_add(fd, None, WRITE | ERR, consolidate=True)
                      for fd in diff(active_writes)]
                 else:
-                    [hub_remove(fd) for fd in diff(active_writes)]
+                    fds = diff(active_writes)
+                    print('>>> REMOVING ALL: %r' % (fds,))
+                    [hub_remove(fd) for fd in fds]
         self.on_poll_start = on_poll_start
 
         def on_inqueue_close(fd, proc):

+ 4 - 0
celery/tests/backends/test_mongodb.py

@@ -402,6 +402,10 @@ class test_MongoBackend(AppCase):
 
 class test_MongoBackend_no_mock(AppCase):
 
+    def setup(self):
+        if pymongo is None:
+            raise SkipTest('pymongo is not installed.')
+
     def test_encode_decode(self):
         backend = MongoBackend(app=self.app)
         data = {'foo': 1}

+ 8 - 0
celery/tests/concurrency/test_prefork.py

@@ -198,6 +198,10 @@ class PoolCase(AppCase):
 
 class test_AsynPool(PoolCase):
 
+    def setup(self):
+        if sys.platform == 'win32':
+            raise SkipTest('win32: skip')
+
     def test_gen_not_started(self):
 
         def gen():
@@ -303,6 +307,10 @@ class test_AsynPool(PoolCase):
 
 class test_ResultHandler(PoolCase):
 
+    def setup(self):
+        if sys.platform == 'win32':
+            raise SkipTest('win32: skip')
+
     def test_process_result(self):
         x = asynpool.ResultHandler(
             Mock(), Mock(), {}, Mock(),