saghul / pyuv

Python interface for libuv
https://pyuv.readthedocs.io
MIT License
1.12k stars 105 forks source link

LoopRunTest.test_stop fails with libuv 1.45.0+ #279

Open MeggyCal opened 1 year ago

MeggyCal commented 1 year ago

It passes again with the following changes (but it might not be the correct approach):

Index: pyuv-1.4.0/tests/test_loop.py
===================================================================
--- pyuv-1.4.0.orig/tests/test_loop.py
+++ pyuv-1.4.0/tests/test_loop.py
@@ -48,9 +48,9 @@ class LoopRunTest(TestCase):
         prepare.start(prepare_cb)
         self.loop.run(pyuv.UV_RUN_DEFAULT)
         self.assertEqual(self.timer_called, 1)
-        self.assertTrue(self.prepare_called >= 2)
+        self.assertEqual(self.prepare_called, 1)
         self.loop.run(pyuv.UV_RUN_NOWAIT)
-        self.assertTrue(self.prepare_called >= 3)
+        self.assertEqual(self.prepare_called, 2)
         self.loop.run(pyuv.UV_RUN_DEFAULT)
         self.assertEqual(self.timer_called, 10)
         self.assertEqual(self.prepare_called, 10)

From libuv changelog:

* stream: process more than one write req per loop tick (ywave620)

This could be the problem, but there are more loop changes.

I first observed this failure when updating from libuv 1.44 to 1.46 on openSUSE Tumbleweed (yes, we are using system libuv, I am aware that this is not supported by you). We are running basically the master branch of pyuv and it was working just fine with libuv 1.44.