Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.snitun: disable failing test on darwin #119009

Merged
merged 1 commit into from Apr 11, 2021

Conversation

mweinelt
Copy link
Member

@mweinelt mweinelt commented Apr 10, 2021

Motivation for this change

https://hydra.nixos.org/job/nixpkgs/trunk/python38Packages.snitun.x86_64-darwin

The upstream advertises this package as "OS independent", but from
issues it is clear they cannot test it on MacOS. So we simply disable
this test.

______________________ test_peer_listener_timeout[pyloop] ______________________

raise_timeout = None
peer_manager = <snitun.server.peer_manager.PeerManager object at 0x10a4a6df0>
peer_listener = <snitun.server.listener_peer.PeerListener object at 0x10a4a6a30>
test_client_peer = Client(reader=<StreamReader exception=ConnectionResetError(54, 'Connection reset by peer') transport=<_SelectorSocketT...by peer') transport=<_SelectorSocketTransport closed fd=19>>>, close=<asyncio.locks.Event object at 0x10909ee50 [set]>)

    async def test_peer_listener_timeout(
        raise_timeout, peer_manager, peer_listener, test_client_peer
    ):
        """Run a full flow of with a peer."""
        valid = datetime.utcnow() + timedelta(days=1)
        aes_key = os.urandom(32)
        aes_iv = os.urandom(16)
        hostname = "localhost"
        fernet_token = create_peer_config(valid.timestamp(), hostname, aes_key, aes_iv)

        crypto = CryptoTransport(aes_key, aes_iv)

        test_client_peer.writer.write(fernet_token)
        await test_client_peer.writer.drain()

        with pytest.raises(asyncio.IncompleteReadError):
>           token = await test_client_peer.reader.readexactly(32)

tests/server/test_listener_peer.py:110:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/dpa7p7v00xvr26dv2myh3k5p1zkagqsm-python3-3.8.5/lib/python3.8/asyncio/streams.py:723: in readexactly
    await self._wait_for_data('readexactly')
/nix/store/dpa7p7v00xvr26dv2myh3k5p1zkagqsm-python3-3.8.5/lib/python3.8/asyncio/streams.py:517: in _wait_for_data
    await self._waiter
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_SelectorSocketTransport closed fd=19>

    def _read_ready__data_received(self):
        if self._conn_lost:
            return
        try:
>           data = self._sock.recv(self.max_size)
E           ConnectionResetError: [Errno 54] Connection reset by peer
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The upstream advertises this package as "OS independent", but from
issues it is clear they cannot test it on MacOS. So we simply disable
this test.

```
______________________ test_peer_listener_timeout[pyloop] ______________________

raise_timeout = None
peer_manager = <snitun.server.peer_manager.PeerManager object at 0x10a4a6df0>
peer_listener = <snitun.server.listener_peer.PeerListener object at 0x10a4a6a30>
test_client_peer = Client(reader=<StreamReader exception=ConnectionResetError(54, 'Connection reset by peer') transport=<_SelectorSocketT...by peer') transport=<_SelectorSocketTransport closed fd=19>>>, close=<asyncio.locks.Event object at 0x10909ee50 [set]>)

    async def test_peer_listener_timeout(
        raise_timeout, peer_manager, peer_listener, test_client_peer
    ):
        """Run a full flow of with a peer."""
        valid = datetime.utcnow() + timedelta(days=1)
        aes_key = os.urandom(32)
        aes_iv = os.urandom(16)
        hostname = "localhost"
        fernet_token = create_peer_config(valid.timestamp(), hostname, aes_key, aes_iv)

        crypto = CryptoTransport(aes_key, aes_iv)

        test_client_peer.writer.write(fernet_token)
        await test_client_peer.writer.drain()

        with pytest.raises(asyncio.IncompleteReadError):
>           token = await test_client_peer.reader.readexactly(32)

tests/server/test_listener_peer.py:110:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/dpa7p7v00xvr26dv2myh3k5p1zkagqsm-python3-3.8.5/lib/python3.8/asyncio/streams.py:723: in readexactly
    await self._wait_for_data('readexactly')
/nix/store/dpa7p7v00xvr26dv2myh3k5p1zkagqsm-python3-3.8.5/lib/python3.8/asyncio/streams.py:517: in _wait_for_data
    await self._waiter
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <_SelectorSocketTransport closed fd=19>

    def _read_ready__data_received(self):
        if self._conn_lost:
            return
        try:
>           data = self._sock.recv(self.max_size)
E           ConnectionResetError: [Errno 54] Connection reset by peer
```
@stephank
Copy link
Contributor

stephank commented Apr 10, 2021

Hmm, tests appear to be trouble in general. For example, nixpkgs-review does concurrent builds on Python 3.8 and 3.9 locally, but it's trying to listen on a specific port and bind fails with a conflict. Even with sandboxing, there's no network namespacing, unlike Linux. I don't know how Hydra works, but maybe it schedules builds differently and won't have this issue?

I did separate builds for python38Packages.snitun and python39Packages.snitun, as well as for hass-nabucasa (which nixpkgs-review marked for rebuild) and those builds went fine, but they also work on master. So maybe it was just the port conflict all along? 😕

Now that I have cache locally for those, nixpkgs-review pr 118965 (the certbot PR) also succeeds.

@SuperSandro2000
Copy link
Member

@ofborg eval

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Apr 10, 2021
@ofborg ofborg bot requested a review from Scriptkiddi April 10, 2021 15:12
@veprbl veprbl merged commit 7644480 into NixOS:master Apr 11, 2021
@mweinelt mweinelt deleted the python/snitun branch April 11, 2021 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants