From 2d079e12e685e4d49e9a7d9c7091b13e3655870f Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 5 May 2019 19:22:06 -0400 Subject: [PATCH 1/2] appveyor: set TOXENV separately for each python version Builds are failing on appveyor because it's trying to install `noiseprotocol` all the time, when it's only installable under py3. Thanks to @julian and julian/jsonschema 's .appveyor for the hints. --- .appveyor.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index c583ab2..826636f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -12,13 +12,20 @@ environment: # For Python versions available on Appveyor, see # http://www.appveyor.com/docs/installed-software#python - PYTHON: "C:\\Python27" + TOXENV: py27-nodilate - PYTHON: "C:\\Python27-x64" DISTUTILS_USE_SDK: "1" + TOXENV: py27-nodilate - PYTHON: "C:\\Python35" + TOXENV: py35 - PYTHON: "C:\\Python35-x64" + TOXENV: py35 - PYTHON: "C:\\Python36" + TOXENV: py36 - PYTHON: "C:\\Python36-x64" + TOXENV: py36 - PYTHON: "C:\\Python37-x64" + TOXENV: py37 matrix: allow_failures: @@ -42,7 +49,7 @@ test_script: # the interpreter you're using - Appveyor does not do anything special # to put the Python evrsion you want to use on PATH. - | - misc\windows-build.cmd %PYTHON%\Scripts\tox.exe -e py + misc\windows-build.cmd %PYTHON%\Scripts\tox.exe after_test: # This step builds your wheels. From 34a190a6dabc7b66ea638e9975851b3cc48d9b9b Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 6 May 2019 01:15:27 -0400 Subject: [PATCH 2/2] dilate/connector: trap the right errors If we had multiple potential connections, the act of cancelling the losing ones was putting an error into log.err(), which flunked the tests. This happened to appear on windows because the appveyor environment has different interfaces than travis hosts. --- src/wormhole/_dilation/connector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wormhole/_dilation/connector.py b/src/wormhole/_dilation/connector.py index 638a827..83914e3 100644 --- a/src/wormhole/_dilation/connector.py +++ b/src/wormhole/_dilation/connector.py @@ -6,10 +6,11 @@ from attr.validators import instance_of, provides, optional from automat import MethodicalMachine from zope.interface import implementer from twisted.internet.task import deferLater -from twisted.internet.defer import DeferredList +from twisted.internet.defer import DeferredList, CancelledError from twisted.internet.endpoints import serverFromString from twisted.internet.protocol import ClientFactory, ServerFactory from twisted.internet.address import HostnameAddress, IPv4Address, IPv6Address +from twisted.internet.error import ConnectingCancelledError from twisted.python import log from .. import ipaddrs # TODO: move into _dilation/ from .._interfaces import IDilationConnector, IDilationManager @@ -308,6 +309,8 @@ class Connector(object): desc = describe_hint_obj(h, is_relay, self._tor) d = deferLater(self._reactor, delay, self._connect, ep, desc, is_relay) + d.addErrback(lambda f: f.trap(ConnectingCancelledError, + CancelledError)) d.addErrback(log.err) self._pending_connectors.add(d)