tags 1032553 + patch

thanks

On Wed, Apr 05, 2023 at 09:22:45AM +0200, Sascha Steinbiss wrote:
> Hi all,
> 
> [...]
> > This is mentioned in
> > https://github.com/magic-wormhole/magic-wormhole/issues/458 as likely
> > a "timing issue". Not sure if it's fixed upstream. >
> 
> Could it make sense to also patch the tests to include the delay that is
> mentioned in the GitHub issue comments?

I've tried adding a 2 second delay in the failing test and that yields a
package that builds reliably for me. I just rebuild the package with the
patch 250 times successfully in a row.

This patch works without any other commits backported.

--- magic-wormhole-0.12.0/src/wormhole/test/test_wormhole.py    2021-02-05 
02:16:21.000000000 +0000
+++ magic-wormhole-0.12.0.fix/src/wormhole/test/test_wormhole.py        
2023-04-07 14:44:26.792819150 +0000
@@ -6,6 +6,7 @@
 from twisted.internet import reactor
 from twisted.internet.defer import gatherResults, inlineCallbacks, returnValue
 from twisted.internet.error import ConnectionRefusedError
+from twisted.internet.task import deferLater
 from twisted.trial import unittest
 
 import mock
@@ -505,6 +506,7 @@
         yield self.assertFailure(w1.get_welcome(), WrongPasswordError)  # late
 
         yield self.assertFailure(w1.close(), WrongPasswordError)
+        yield deferLater(reactor, 2, lambda: None)
         yield self.assertFailure(w2.close(), WrongPasswordError)
 
     @inlineCallbacks


I'm not a DD, so i can't upload any fixes, but i would really appreciate
if we can get this fixed before the auto removal strikes.

Regards,

 - Martin
--- magic-wormhole-0.12.0/src/wormhole/test/test_wormhole.py	2021-02-05 02:16:21.000000000 +0000
+++ magic-wormhole-0.12.0.fix/src/wormhole/test/test_wormhole.py	2023-04-07 14:44:26.792819150 +0000
@@ -6,6 +6,7 @@
 from twisted.internet import reactor
 from twisted.internet.defer import gatherResults, inlineCallbacks, returnValue
 from twisted.internet.error import ConnectionRefusedError
+from twisted.internet.task import deferLater
 from twisted.trial import unittest
 
 import mock
@@ -505,6 +506,7 @@
         yield self.assertFailure(w1.get_welcome(), WrongPasswordError)  # late
 
         yield self.assertFailure(w1.close(), WrongPasswordError)
+        yield deferLater(reactor, 2, lambda: None)
         yield self.assertFailure(w2.close(), WrongPasswordError)
 
     @inlineCallbacks

Reply via email to