magic-wormhole / magic-wormhole-transit-relay

Transit Relay server for Magic-Wormhole
MIT License
169 stars 42 forks source link

test_backpressure.py::TransitWebSockets::test_buffer_fills - twisted.internet.error.ProcessExitedAlready #39

Closed hacklschorsch closed 6 hours ago

hacklschorsch commented 8 hours ago

I have a failing test when building as part of ZKAPAuthorizer (with Python 3.10 and 3.11):

magic-wormhole-transit-relay> ___________ ERROR at teardown of TransitWebSockets.test_buffer_fills ___________
magic-wormhole-transit-relay>
magic-wormhole-transit-relay>     def cleanup_process():
magic-wormhole-transit-relay> >       transit_proc.signalProcess("HUP")
magic-wormhole-transit-relay>
magic-wormhole-transit-relay> src/wormhole_transit_relay/test/test_backpressure.py:129:
magic-wormhole-transit-relay> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
magic-wormhole-transit-relay>
magic-wormhole-transit-relay> self = <Process pid=None status=0>, signalID = <Signals.SIGHUP: 1>
magic-wormhole-transit-relay>
magic-wormhole-transit-relay>     def signalProcess(self, signalID):
magic-wormhole-transit-relay>         """
magic-wormhole-transit-relay>         Send the given signal C{signalID} to the process. It'll translate a
magic-wormhole-transit-relay>         few signals ('HUP', 'STOP', 'INT', 'KILL', 'TERM') from a string
magic-wormhole-transit-relay>         representation to its int value, otherwise it'll pass directly the
magic-wormhole-transit-relay>         value provided
magic-wormhole-transit-relay>
magic-wormhole-transit-relay>         @type signalID: C{str} or C{int}
magic-wormhole-transit-relay>         """
magic-wormhole-transit-relay>         if signalID in ("HUP", "STOP", "INT", "KILL", "TERM"):
magic-wormhole-transit-relay>             signalID = getattr(signal, f"SIG{signalID}")
magic-wormhole-transit-relay>         if self.pid is None:
magic-wormhole-transit-relay> >           raise ProcessExitedAlready()
magic-wormhole-transit-relay> E           twisted.internet.error.ProcessExitedAlready
magic-wormhole-transit-relay>
magic-wormhole-transit-relay> /nix/store/h6dp2q0ka4gvayw7xjs0hg7x6hlm1xy2-python3.10-twisted-24.3.0/lib/python3.10/site-packages/twisted/internet/process.py:343: ProcessExitedAlready
=========================== short test summary info ============================
FAILED src/wormhole_transit_relay/test/test_backpressure.py::TransitWebSockets::test_buffer_fills - Failed: NOTE: Incompatible Exception Representation, displaying natively:
ERROR src/wormhole_transit_relay/test/test_backpressure.py::TransitWebSockets::test_buffer_fills - twisted.internet.error.ProcessExitedAlready
======== 1 failed, 90 passed, 5 warnings, 1 error in 120.82s (0:02:00) =========
hacklschorsch commented 8 hours ago

I don't know how important the fact this is failing on teardown. Should the server not crash at all and there's more to investigate - or is it fine to ignore a broken teardown ?

meejah commented 6 hours ago

The CI in this project already runs against 3.10 and 3.11. Can you say what is different in your setup, or how to reproduce?

hacklschorsch commented 6 hours ago

I currently can't reproduce it out of the ZKAPAuthorizer build (here's for ZKAPAuthorizer CI failure with above problem). Still investigating...

hacklschorsch commented 6 hours ago

I guess this is a murk-up with the Nix packaging around it. For the backpressure integration test, a transitrelay is run, and that seems to fail during build from within ZKAPAuthorizer:

/nix/store/jw4k97j4rzy0cxv2xpfdvrqfn2js44dq-python3.11-twisted-24.3.0/bin/twistd -n: Unknown command: transitrelay

I don't know why this happens - I copied the nix from nixkpgs

...

Bleh.

I vendored the version from current stable nixpkgs when the nixpkgs maintainer already fixed the problem I am running into two weeks ago.

That patch is quite something!

# magic-wormhole relies on the internal API of
# magic-wormhole-transit-relay < 0.3.0 for testing.

Let's see how that works out. Anyway, sorry for the noise, my problem is not with this project but with Nix

meejah commented 4 hours ago

magic-wormhole relies on the internal API of magic-wormhole-transit-relay < 0.3.0 for testing.

This is not true for latest releases