Diff of the two buildlogs: -- --- b1/build.log 2025-04-16 00:50:04.741292037 +0000 +++ b2/build.log 2025-04-17 00:50:07.659656386 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Mon May 18 19:10:45 -12 2026 -I: pbuilder-time-stamp: 1779174645 +I: Current time: Wed Apr 16 14:50:07 +14 2025 +I: pbuilder-time-stamp: 1744764607 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/unstable-reproducible-base.tgz] I: copying local configuration @@ -22,52 +22,84 @@ dpkg-source: info: unpacking python-snitun_0.41.7-1.debian.tar.xz I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/388847/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/2409438/tmp/hooks/D01_modify_environment starting +debug: Running on ionos11-amd64. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Apr 16 00:50 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/2409438/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/2409438/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='amd64' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=42 ' - DISTRIBUTION='unstable' - HOME='/root' - HOST_ARCH='amd64' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="37" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.2.37(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=amd64 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=40 ' + DIRSTACK=() + DISTRIBUTION=unstable + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='06031ef12e6049d3a0e234d45ffca056' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='388847' - PS1='# ' - PS2='> ' + INVOCATION_ID=72bd7447b7c14cd59180b99bca3c18d3 + LANG=C + LANGUAGE=et_EE:et + LC_ALL=C + MACHTYPE=x86_64-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=2409438 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.C7EMw3jA/pbuilderrc_JaF4 --distribution unstable --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.C7EMw3jA/b1 --logfile b1/build.log python-snitun_0.41.7-1.dsc' - SUDO_GID='110' - SUDO_UID='105' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://213.165.73.152:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.C7EMw3jA/pbuilderrc_ylyL --distribution unstable --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.C7EMw3jA/b2 --logfile b2/build.log python-snitun_0.41.7-1.dsc' + SUDO_GID=111 + SUDO_UID=106 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://46.16.76.132:3128 I: uname -a - Linux ionos5-amd64 6.12.12+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.12-1~bpo12+1 (2025-02-23) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-33-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.133-1 (2025-04-10) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Mar 4 2025 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/388847/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Mar 4 11:20 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/2409438/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -210,7 +242,7 @@ Get: 81 http://deb.debian.org/debian unstable/main amd64 python3-pytest-asyncio all 0.25.1-1 [16.7 kB] Get: 82 http://deb.debian.org/debian unstable/main amd64 python3-pytest-aiohttp all 1.1.0-1 [6192 B] Get: 83 http://deb.debian.org/debian unstable/main amd64 python3-pytest-timeout all 2.3.1-1 [21.9 kB] -Fetched 21.6 MB in 8s (2800 kB/s) +Fetched 21.6 MB in 0s (48.9 MB/s) Preconfiguring packages ... Selecting previously unselected package libpython3.13-minimal:amd64. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19840 files and directories currently installed.) @@ -486,8 +518,8 @@ Setting up tzdata (2025b-2) ... Current default time zone: 'Etc/UTC' -Local time is now: Tue May 19 07:11:59 UTC 2026. -Universal Time is now: Tue May 19 07:11:59 UTC 2026. +Local time is now: Wed Apr 16 00:51:16 UTC 2025. +Universal Time is now: Wed Apr 16 00:51:16 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up autotools-dev (20240727.1) ... @@ -569,7 +601,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/python-snitun-0.41.7/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../python-snitun_0.41.7-1_source.changes +I: user script /srv/workspace/pbuilder/2409438/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for unstable +I: user script /srv/workspace/pbuilder/2409438/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/python-snitun-0.41.7/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../python-snitun_0.41.7-1_source.changes dpkg-buildpackage: info: source package python-snitun dpkg-buildpackage: info: source version 0.41.7-1 dpkg-buildpackage: info: source distribution unstable @@ -596,8 +632,8 @@ ******************************************************************************** Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0). - This deprecation is overdue, please update your project and remove deprecated - calls to avoid build errors in the future. + By 2026-Feb-18, you need to update your project and remove deprecated calls + or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** @@ -634,32 +670,32 @@ running build running build_py creating build/lib/snitun -copying snitun/exceptions.py -> build/lib/snitun copying snitun/__init__.py -> build/lib/snitun +copying snitun/exceptions.py -> build/lib/snitun creating build/lib/snitun/multiplexer -copying snitun/multiplexer/const.py -> build/lib/snitun/multiplexer -copying snitun/multiplexer/channel.py -> build/lib/snitun/multiplexer -copying snitun/multiplexer/queue.py -> build/lib/snitun/multiplexer copying snitun/multiplexer/__init__.py -> build/lib/snitun/multiplexer +copying snitun/multiplexer/queue.py -> build/lib/snitun/multiplexer copying snitun/multiplexer/message.py -> build/lib/snitun/multiplexer +copying snitun/multiplexer/channel.py -> build/lib/snitun/multiplexer copying snitun/multiplexer/core.py -> build/lib/snitun/multiplexer +copying snitun/multiplexer/const.py -> build/lib/snitun/multiplexer copying snitun/multiplexer/crypto.py -> build/lib/snitun/multiplexer +creating build/lib/snitun/utils +copying snitun/utils/__init__.py -> build/lib/snitun/utils +copying snitun/utils/asyncio.py -> build/lib/snitun/utils +copying snitun/utils/aes.py -> build/lib/snitun/utils +copying snitun/utils/server.py -> build/lib/snitun/utils +copying snitun/utils/aiohttp_client.py -> build/lib/snitun/utils +copying snitun/utils/ipaddress.py -> build/lib/snitun/utils creating build/lib/snitun/server +copying snitun/server/__init__.py -> build/lib/snitun/server +copying snitun/server/worker.py -> build/lib/snitun/server copying snitun/server/peer_manager.py -> build/lib/snitun/server -copying snitun/server/listener_peer.py -> build/lib/snitun/server -copying snitun/server/listener_sni.py -> build/lib/snitun/server copying snitun/server/peer.py -> build/lib/snitun/server -copying snitun/server/worker.py -> build/lib/snitun/server -copying snitun/server/__init__.py -> build/lib/snitun/server +copying snitun/server/listener_sni.py -> build/lib/snitun/server copying snitun/server/sni.py -> build/lib/snitun/server copying snitun/server/run.py -> build/lib/snitun/server -creating build/lib/snitun/utils -copying snitun/utils/aes.py -> build/lib/snitun/utils -copying snitun/utils/ipaddress.py -> build/lib/snitun/utils -copying snitun/utils/aiohttp_client.py -> build/lib/snitun/utils -copying snitun/utils/__init__.py -> build/lib/snitun/utils -copying snitun/utils/asyncio.py -> build/lib/snitun/utils -copying snitun/utils/server.py -> build/lib/snitun/utils +copying snitun/server/listener_peer.py -> build/lib/snitun/server creating build/lib/snitun/client copying snitun/client/__init__.py -> build/lib/snitun/client copying snitun/client/connector.py -> build/lib/snitun/client @@ -679,41 +715,41 @@ running install_lib creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/snitun -copying build/lib/snitun/exceptions.py -> build/bdist.linux-x86_64/wheel/./snitun +copying build/lib/snitun/__init__.py -> build/bdist.linux-x86_64/wheel/./snitun creating build/bdist.linux-x86_64/wheel/snitun/multiplexer -copying build/lib/snitun/multiplexer/const.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer -copying build/lib/snitun/multiplexer/channel.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer -copying build/lib/snitun/multiplexer/queue.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer copying build/lib/snitun/multiplexer/__init__.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer +copying build/lib/snitun/multiplexer/queue.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer copying build/lib/snitun/multiplexer/message.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer +copying build/lib/snitun/multiplexer/channel.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer copying build/lib/snitun/multiplexer/core.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer +copying build/lib/snitun/multiplexer/const.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer copying build/lib/snitun/multiplexer/crypto.py -> build/bdist.linux-x86_64/wheel/./snitun/multiplexer +creating build/bdist.linux-x86_64/wheel/snitun/utils +copying build/lib/snitun/utils/__init__.py -> build/bdist.linux-x86_64/wheel/./snitun/utils +copying build/lib/snitun/utils/asyncio.py -> build/bdist.linux-x86_64/wheel/./snitun/utils +copying build/lib/snitun/utils/aes.py -> build/bdist.linux-x86_64/wheel/./snitun/utils +copying build/lib/snitun/utils/server.py -> build/bdist.linux-x86_64/wheel/./snitun/utils +copying build/lib/snitun/utils/aiohttp_client.py -> build/bdist.linux-x86_64/wheel/./snitun/utils +copying build/lib/snitun/utils/ipaddress.py -> build/bdist.linux-x86_64/wheel/./snitun/utils creating build/bdist.linux-x86_64/wheel/snitun/server +copying build/lib/snitun/server/__init__.py -> build/bdist.linux-x86_64/wheel/./snitun/server +copying build/lib/snitun/server/worker.py -> build/bdist.linux-x86_64/wheel/./snitun/server copying build/lib/snitun/server/peer_manager.py -> build/bdist.linux-x86_64/wheel/./snitun/server -copying build/lib/snitun/server/listener_peer.py -> build/bdist.linux-x86_64/wheel/./snitun/server -copying build/lib/snitun/server/listener_sni.py -> build/bdist.linux-x86_64/wheel/./snitun/server copying build/lib/snitun/server/peer.py -> build/bdist.linux-x86_64/wheel/./snitun/server -copying build/lib/snitun/server/worker.py -> build/bdist.linux-x86_64/wheel/./snitun/server -copying build/lib/snitun/server/__init__.py -> build/bdist.linux-x86_64/wheel/./snitun/server +copying build/lib/snitun/server/listener_sni.py -> build/bdist.linux-x86_64/wheel/./snitun/server copying build/lib/snitun/server/sni.py -> build/bdist.linux-x86_64/wheel/./snitun/server copying build/lib/snitun/server/run.py -> build/bdist.linux-x86_64/wheel/./snitun/server -creating build/bdist.linux-x86_64/wheel/snitun/utils -copying build/lib/snitun/utils/aes.py -> build/bdist.linux-x86_64/wheel/./snitun/utils -copying build/lib/snitun/utils/ipaddress.py -> build/bdist.linux-x86_64/wheel/./snitun/utils -copying build/lib/snitun/utils/aiohttp_client.py -> build/bdist.linux-x86_64/wheel/./snitun/utils -copying build/lib/snitun/utils/__init__.py -> build/bdist.linux-x86_64/wheel/./snitun/utils -copying build/lib/snitun/utils/asyncio.py -> build/bdist.linux-x86_64/wheel/./snitun/utils -copying build/lib/snitun/utils/server.py -> build/bdist.linux-x86_64/wheel/./snitun/utils -copying build/lib/snitun/__init__.py -> build/bdist.linux-x86_64/wheel/./snitun +copying build/lib/snitun/server/listener_peer.py -> build/bdist.linux-x86_64/wheel/./snitun/server creating build/bdist.linux-x86_64/wheel/snitun/client copying build/lib/snitun/client/__init__.py -> build/bdist.linux-x86_64/wheel/./snitun/client copying build/lib/snitun/client/connector.py -> build/bdist.linux-x86_64/wheel/./snitun/client copying build/lib/snitun/client/client_peer.py -> build/bdist.linux-x86_64/wheel/./snitun/client +copying build/lib/snitun/exceptions.py -> build/bdist.linux-x86_64/wheel/./snitun running install_egg_info Copying snitun.egg-info to build/bdist.linux-x86_64/wheel/./snitun-0.41.7.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/snitun-0.41.7.dist-info/WHEEL -creating '/build/reproducible-path/python-snitun-0.41.7/.pybuild/cpython3_3.13/.tmp-9w2ab2t9/snitun-0.41.7-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it +creating '/build/reproducible-path/python-snitun-0.41.7/.pybuild/cpython3_3.13/.tmp-v8h5wp57/snitun-0.41.7-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'snitun/__init__.py' adding 'snitun/exceptions.py' adding 'snitun/client/__init__.py' @@ -758,7 +794,7 @@ platform linux -- Python 3.13.3, pytest-8.3.5, pluggy-1.5.0 rootdir: /build/reproducible-path/python-snitun-0.41.7/.pybuild/cpython3_3.13/build configfile: pyproject.toml -plugins: asyncio-0.25.1, typeguard-4.4.2, timeout-2.3.1, aiohttp-1.1.0 +plugins: asyncio-0.25.1, timeout-2.3.1, aiohttp-1.1.0, typeguard-4.4.2 asyncio: mode=Mode.AUTO, asyncio_default_fixture_loop_scope=None collected 162 items @@ -774,7 +810,16 @@ tests/server/test_listener_sni.py ............ [ 64%] tests/server/test_peer.py ...... [ 67%] tests/server/test_peer_manager.py .......... [ 74%] -tests/server/test_run.py .............. [ 82%] +tests/server/test_run.py .........FFFException ignored in: +Traceback (most recent call last): + File "/build/reproducible-path/python-snitun-0.41.7/.pybuild/cpython3_3.13/build/snitun/multiplexer/core.py", line 208, in _runner + to_peer.cancel() + File "/usr/lib/python3.13/asyncio/base_events.py", line 827, in call_soon + self._check_closed() + File "/usr/lib/python3.13/asyncio/base_events.py", line 550, in _check_closed + raise RuntimeError('Event loop is closed') +RuntimeError: Event loop is closed +FF [ 82%] tests/server/test_sni.py .......... [ 88%] tests/server/test_worker.py .... [ 91%] tests/utils/test_aes.py .. [ 92%] @@ -783,6 +828,352 @@ tests/utils/test_ipaddress.py .. [ 98%] tests/utils/test_server.py .. [100%] +=================================== FAILURES =================================== +_____________________ test_snitun_worker_runner[payloads2] _____________________ + +event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False> +payloads = [b'\x16\x03\x01\x00H\x01', b'\x00\x00B\x03\x03\xff\xff\xff\xff\xff\xff\xff\xff\xff', b'\xff\xff\xff\xff\xff\xff\xff\xf...ff\xff\xff\x00\x00\x04\x00\x01\x00\xff\x01\x00\x00\x17\x00\x00\x00\x0e\x00\x0c\x00\x00\tlocalhost\x00\x0f\x00\x01\x01'] + + @pytest.mark.parametrize( + "payloads", + [ + [TLS_1_2], + [TLS_1_2[:6], TLS_1_2[6:]], + [TLS_1_2[:6], TLS_1_2[6:20], TLS_1_2[20:]], + [TLS_1_2[:6], TLS_1_2[6:20], TLS_1_2[20:32], TLS_1_2[32:]], + ], + ) + def test_snitun_worker_runner( + event_loop: asyncio.AbstractEventLoop, + payloads: list[bytes], + ) -> None: + """Test SniTunWorker Server runner object.""" + loop = event_loop + peer_messages = [] + peer_address = [] + + server = SniTunServerWorker( + FERNET_TOKENS, + host="127.0.0.1", + port=32001, + worker_size=2, + ) + server.start() + + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(("127.0.0.1", 32001)) + + valid = datetime.now(tz=UTC) + 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) + + sock.sendall(fernet_token) + + token = sock.recv(32) + token = hashlib.sha256(crypto.decrypt(token)).digest() + sock.sendall(crypto.encrypt(token)) + + time.sleep(1) + assert any(worker.is_responsible_peer(hostname) for worker in server._workers) + assert server.peer_counter == 1 + + async def mock_new_channel( + multiplexer: Multiplexer, + channel: MultiplexerChannel, + ) -> None: + """Mock new channel.""" + while True: + message = await channel.read() + peer_messages.append(message) + peer_address.append(channel.ip_address) + + sock_ssl = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock_ssl.connect(("127.0.0.1", 32001)) + + async def _create_multiplexer() -> Multiplexer: + """Create and return the peer multiplexer.""" + reader_peer, writer_peer = await asyncio.open_connection(sock=sock) + return Multiplexer(crypto, reader_peer, writer_peer, mock_new_channel) + + multiplexer = loop.run_until_complete(_create_multiplexer()) + + for payload in payloads: + sock_ssl.sendall(payload) + loop.run_until_complete(asyncio.sleep(0.1)) + +> assert peer_messages +E assert [] + +tests/server/test_run.py:347: AssertionError +---------------------------- Captured stderr setup ----------------------------- +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log setup ------------------------------ +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +----------------------------- Captured stderr call ----------------------------- +INFO:snitun.server.run:Run SniTun with 2 worker +INFO:snitun.server.worker:Start worker: ServerWorker-13 +DEBUG:asyncio:Using selector: EpollSelector +INFO:snitun.server.run:Server started, fd: 17 +DEBUG:snitun.server.run:Handover new peer connection: b'gAAAAABn_v9FlwLkKhllryULMYbuw14E8fR8835jKZuUnli9MmbGG19yUZG8yenrDKNnQcmMhAPSkdoxaubvwDncss7y4aVHfKCLiN-s_XgqZmBJ0u3DqkR6DudIl3FC1DPgWqjvduk7DlXLiS2xqKyzP7DQi6o5HSO21Gjp1NUvh8zLSApCQw6ol5i0apqsWW3FhC9VhS2Mzn3PbFfms4PgvjL1YyiMzY6nvKICctw3ddSSRZl5AnP5AQilN7VXv8ZgTiT1-Md2-FWTO_5cbNYhovtts8SjRsD-rLGMM0q1ArprM0AedG8umucG1JUMzNBqf51CWlgo' +DEBUG:snitun.server.peer_manager:New peer connection: localhost +INFO:snitun.server.worker:Start worker: ServerWorker-15 +DEBUG:asyncio:Using selector: EpollSelector +DEBUG:snitun.server.sni:Can't calculate the TLS record size +DEBUG:snitun.server.sni:Can't calculate the TLS record size +DEBUG:snitun.server.run:Handover localhost to ServerWorker-13 +DEBUG:snitun.server.listener_sni:Processing for hostname localhost started +DEBUG:snitun.multiplexer.queue:Queue creating channel f8b2cc07ed3d58a11f4491644e9d4a9a +DEBUG:snitun.multiplexer.channel:Sending new channel f8b2cc07ed3d58a11f4491644e9d4a9a +------------------------------ Captured log call ------------------------------- +INFO snitun.server.run:run.py:225 Run SniTun with 2 worker +INFO snitun.server.run:run.py:266 Server started, fd: 17 +DEBUG snitun.server.run:run.py:341 Handover new peer connection: b'gAAAAABn_v9FlwLkKhllryULMYbuw14E8fR8835jKZuUnli9MmbGG19yUZG8yenrDKNnQcmMhAPSkdoxaubvwDncss7y4aVHfKCLiN-s_XgqZmBJ0u3DqkR6DudIl3FC1DPgWqjvduk7DlXLiS2xqKyzP7DQi6o5HSO21Gjp1NUvh8zLSApCQw6ol5i0apqsWW3FhC9VhS2Mzn3PbFfms4PgvjL1YyiMzY6nvKICctw3ddSSRZl5AnP5AQilN7VXv8ZgTiT1-Md2-FWTO_5cbNYhovtts8SjRsD-rLGMM0q1ArprM0AedG8umucG1JUMzNBqf51CWlgo' +DEBUG snitun.server.sni:sni.py:66 Can't calculate the TLS record size +DEBUG snitun.server.sni:sni.py:66 Can't calculate the TLS record size +DEBUG snitun.server.run:run.py:371 Handover localhost to ServerWorker-13 +--------------------------- Captured stderr teardown --------------------------- +DEBUG:asyncio:Using selector: EpollSelector +---------------------------- Captured log teardown ----------------------------- +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +_____________________ test_snitun_worker_runner[payloads3] _____________________ + +event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False> +payloads = [b'\x16\x03\x01\x00H\x01', b'\x00\x00B\x03\x03\xff\xff\xff\xff\xff\xff\xff\xff\xff', b'\xff\xff\xff\xff\xff\xff\xff\xf...ff\xff\xff\x00\x00\x04\x00\x01\x00\xff\x01\x00\x00\x17\x00\x00\x00\x0e\x00\x0c\x00\x00\tlocalhost\x00\x0f\x00\x01\x01'] + + @pytest.mark.parametrize( + "payloads", + [ + [TLS_1_2], + [TLS_1_2[:6], TLS_1_2[6:]], + [TLS_1_2[:6], TLS_1_2[6:20], TLS_1_2[20:]], + [TLS_1_2[:6], TLS_1_2[6:20], TLS_1_2[20:32], TLS_1_2[32:]], + ], + ) + def test_snitun_worker_runner( + event_loop: asyncio.AbstractEventLoop, + payloads: list[bytes], + ) -> None: + """Test SniTunWorker Server runner object.""" + loop = event_loop + peer_messages = [] + peer_address = [] + + server = SniTunServerWorker( + FERNET_TOKENS, + host="127.0.0.1", + port=32001, + worker_size=2, + ) +> server.start() + +tests/server/test_run.py:300: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = + + def start(self) -> None: + """Run server.""" + # Init first all worker, we don't want the epoll on the childs + _LOGGER.info("Run SniTun with %d worker", self._worker_size) + for _ in range(self._worker_size): + worker = ServerWorker(self._fernet_keys, throttling=self._throttling) + worker.start() + self._workers.append(worker) + + self._server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self._server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +> self._server.bind((self._host, self._port)) +E OSError: [Errno 98] Address already in use + +snitun/server/run.py:233: OSError +---------------------------- Captured stderr setup ----------------------------- +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log setup ------------------------------ +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +----------------------------- Captured stderr call ----------------------------- +INFO:snitun.server.run:Run SniTun with 2 worker +DEBUG:snitun.server.listener_sni:Close TCP session after timeout for f8b2cc07ed3d58a11f4491644e9d4a9a +DEBUG:snitun.multiplexer.channel:Sending close channel f8b2cc07ed3d58a11f4491644e9d4a9a +INFO:snitun.server.worker:Start worker: ServerWorker-17 +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log call ------------------------------- +INFO snitun.server.run:run.py:225 Run SniTun with 2 worker +--------------------------- Captured stderr teardown --------------------------- +DEBUG:asyncio:Using selector: EpollSelector +---------------------------- Captured log teardown ----------------------------- +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +__________________________ test_snitun_worker_timeout __________________________ + +event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False> + + def test_snitun_worker_timeout(event_loop: asyncio.AbstractEventLoop) -> None: + """Test SniTunWorker Server runner object timeout.""" + from snitun.server import run + + run.WORKER_STALE_MAX = 1 + server = SniTunServerWorker( + FERNET_TOKENS, + host="127.0.0.1", + port=32001, + worker_size=2, + ) + +> server.start() + +tests/server/test_run.py:374: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = + + def start(self) -> None: + """Run server.""" + # Init first all worker, we don't want the epoll on the childs + _LOGGER.info("Run SniTun with %d worker", self._worker_size) + for _ in range(self._worker_size): + worker = ServerWorker(self._fernet_keys, throttling=self._throttling) + worker.start() + self._workers.append(worker) + + self._server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self._server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +> self._server.bind((self._host, self._port)) +E OSError: [Errno 98] Address already in use + +snitun/server/run.py:233: OSError +---------------------------- Captured stderr setup ----------------------------- +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log setup ------------------------------ +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +----------------------------- Captured stderr call ----------------------------- +INFO:snitun.server.run:Run SniTun with 2 worker +INFO:snitun.server.worker:Start worker: ServerWorker-19 +DEBUG:asyncio:Using selector: EpollSelector +INFO:snitun.server.worker:Start worker: ServerWorker-21 +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log call ------------------------------- +INFO snitun.server.run:run.py:225 Run SniTun with 2 worker +--------------------------- Captured stderr teardown --------------------------- +DEBUG:asyncio:Using selector: EpollSelector +---------------------------- Captured log teardown ----------------------------- +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +__________________ test_snitun_worker_runner_invalid_payload ___________________ + +event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False> + + def test_snitun_worker_runner_invalid_payload( + event_loop: asyncio.AbstractEventLoop, + ) -> None: + """Test SniTunWorker Server runner invalid payload.""" + server = SniTunServerWorker( + FERNET_TOKENS, + host="127.0.0.1", + port=32001, + worker_size=2, + ) +> server.start() + +tests/server/test_run.py:408: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = + + def start(self) -> None: + """Run server.""" + # Init first all worker, we don't want the epoll on the childs + _LOGGER.info("Run SniTun with %d worker", self._worker_size) + for _ in range(self._worker_size): + worker = ServerWorker(self._fernet_keys, throttling=self._throttling) + worker.start() + self._workers.append(worker) + + self._server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self._server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +> self._server.bind((self._host, self._port)) +E OSError: [Errno 98] Address already in use + +snitun/server/run.py:233: OSError +---------------------------- Captured stderr setup ----------------------------- +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log setup ------------------------------ +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +----------------------------- Captured stderr call ----------------------------- +INFO:snitun.server.run:Run SniTun with 2 worker +INFO:snitun.server.worker:Start worker: ServerWorker-23 +DEBUG:asyncio:Using selector: EpollSelector +INFO:snitun.server.worker:Start worker: ServerWorker-25 +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log call ------------------------------- +INFO snitun.server.run:run.py:225 Run SniTun with 2 worker +--------------------------- Captured stderr teardown --------------------------- +ERROR:asyncio:Task was destroyed but it is pending! +task: wait_for=> +ERROR:asyncio:Task was destroyed but it is pending! +task: wait_for=> +ERROR:asyncio:Task was destroyed but it is pending! +task: wait_for=> +DEBUG:asyncio:Using selector: EpollSelector +---------------------------- Captured log teardown ----------------------------- +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +___________________________ test_snitun_worker_crash ___________________________ + +kill = +event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False> + + @patch("snitun.server.run.os.kill") + def test_snitun_worker_crash( + kill: MagicMock, + event_loop: asyncio.AbstractEventLoop, + ) -> None: + """Test SniTunWorker Server runner object with crashing worker.""" + server = SniTunServerWorker( + FERNET_TOKENS, + host="127.0.0.1", + port=32001, + worker_size=2, + ) + +> server.start() + +tests/server/test_run.py:441: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +self = + + def start(self) -> None: + """Run server.""" + # Init first all worker, we don't want the epoll on the childs + _LOGGER.info("Run SniTun with %d worker", self._worker_size) + for _ in range(self._worker_size): + worker = ServerWorker(self._fernet_keys, throttling=self._throttling) + worker.start() + self._workers.append(worker) + + self._server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self._server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +> self._server.bind((self._host, self._port)) +E OSError: [Errno 98] Address already in use + +snitun/server/run.py:233: OSError +---------------------------- Captured stderr setup ----------------------------- +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log setup ------------------------------ +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector +----------------------------- Captured stderr call ----------------------------- +INFO:snitun.server.run:Run SniTun with 2 worker +INFO:snitun.server.worker:Start worker: ServerWorker-27 +DEBUG:asyncio:Using selector: EpollSelector +INFO:snitun.server.worker:Start worker: ServerWorker-29 +DEBUG:asyncio:Using selector: EpollSelector +------------------------------ Captured log call ------------------------------- +INFO snitun.server.run:run.py:225 Run SniTun with 2 worker +--------------------------- Captured stderr teardown --------------------------- +DEBUG:asyncio:Using selector: EpollSelector +---------------------------- Captured log teardown ----------------------------- +DEBUG asyncio:selector_events.py:64 Using selector: EpollSelector =============================== warnings summary =============================== tests/server/test_listener_sni.py:71 tests/server/test_listener_sni.py:71: PytestDeprecationWarning: test_sni_proxy_flow_close_by_client is asynchronous and explicitly requests the "event_loop" fixture. Asynchronous fixtures and test functions should use "asyncio.get_running_loop()" instead. @@ -806,44 +1197,15 @@ tests/server/test_run.py: 24 warnings tests/server/test_worker.py: 8 warnings - /usr/lib/python3.13/multiprocessing/popen_fork.py:67: DeprecationWarning: This process (pid=457473) is multi-threaded, use of fork() may lead to deadlocks in the child. + /usr/lib/python3.13/multiprocessing/popen_fork.py:67: DeprecationWarning: This process (pid=2415835) is multi-threaded, use of fork() may lead to deadlocks in the child. self.pid = os.fork() -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html -====================== 162 passed, 37 warnings in 42.12s ======================= - create-stamp debian/debhelper-build-stamp - dh_testroot -O--buildsystem=pybuild - dh_prep -O--buildsystem=pybuild - dh_auto_install --destdir=debian/python3-snitun/ -O--buildsystem=pybuild -I: pybuild plugin_pyproject:178: Copying package built for python3.13 to destdir - dh_installdocs -O--buildsystem=pybuild - dh_installchangelogs -O--buildsystem=pybuild - dh_python3 -O--buildsystem=pybuild - dh_installsystemduser -O--buildsystem=pybuild - dh_perl -O--buildsystem=pybuild - dh_link -O--buildsystem=pybuild - dh_strip_nondeterminism -O--buildsystem=pybuild - dh_compress -O--buildsystem=pybuild - dh_fixperms -O--buildsystem=pybuild - dh_missing -O--buildsystem=pybuild - dh_installdeb -O--buildsystem=pybuild - dh_gencontrol -O--buildsystem=pybuild - dh_md5sums -O--buildsystem=pybuild - dh_builddeb -O--buildsystem=pybuild -dpkg-deb: building package 'python3-snitun' in '../python3-snitun_0.41.7-1_all.deb'. - dpkg-genbuildinfo --build=binary -O../python-snitun_0.41.7-1_amd64.buildinfo - dpkg-genchanges --build=binary -O../python-snitun_0.41.7-1_amd64.changes -dpkg-genchanges: info: binary-only upload (no source code included) - dpkg-source --after-build . -dpkg-buildpackage: info: binary-only upload (no source included) -dpkg-genchanges: info: including full source code in upload -I: copying local configuration -I: unmounting dev/ptmx filesystem -I: unmounting dev/pts filesystem -I: unmounting dev/shm filesystem -I: unmounting proc filesystem -I: unmounting sys filesystem -I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/388847 and its subdirectories -I: Current time: Mon May 18 19:13:03 -12 2026 -I: pbuilder-time-stamp: 1779174783 +=========================== short test summary info ============================ +FAILED tests/server/test_run.py::test_snitun_worker_runner[payloads2] - asser... +FAILED tests/server/test_run.py::test_snitun_worker_runner[payloads3] - OSErr... +FAILED tests/server/test_run.py::test_snitun_worker_timeout - OSError: [Errno... +FAILED tests/server/test_run.py::test_snitun_worker_runner_invalid_payload - ... +FAILED tests/server/test_run.py::test_snitun_worker_crash - OSError: [Errno 9... +================= 5 failed, 157 passed, 37 warnings in 54.82s ================== +Thu Apr 17 00:50:07 UTC 2025 - pbuilder was killed by timeout after 24h.