This uses a single TCP connection to the relay server for all
requests (although it probably uses a second one for the downstream
EventSource feed). This should squeeze out some of the round-trip times.
This runs tests directly (with 'coverage run' and 'trial'), rather than
running them inside tox, because that was proving difficult.
It upgrades pip first (the travis builders have an older version), to
use and cache wheels for speed. Travis is now configured to retain the
pip cache between runs.
This installs twisted from trunk (as tox was doing), to work around a
bug in the current twisted-15.5.0 release that should be resolved soon.
Travis is told to ignore any branch named WIP-, so I can transfer
branches between computers without causing red builds.
A coverage report is displayed before uploading to codecov.
The wormhole package is installed as --editable, to make the source
filenames in the coverage data match what I get at home. This also
appears necessary to get codecov to display the data (maybe it ignores
data for files outside the starting directory?).
This adds an expected= argument to Connection.connectConsumer(), which
then returns a Deferred that fires when enough bytes have been written
to the consumer. It also adds Connection.writeToFile(), a helper method
that writes bytes to a filehandle.
I made the classic dataReceived() mistake, and exited the function after
delivering the first record. Keep at it until there are no complete
records left.
The previous commits improve test failures by dropping relay connections
at shutdown, and flunking a test quickly when one client fails but the
other one hangs.
If that doesn't work (say, some client has a time.sleep(), or other
stall that isn't affected by the relay shutdown), we'll be left with an
active thread holding that hanging client.
This patch adds a check to wormhole.test.common.ServerBase.tearDown that
looks for active threads, waits a second (after stopService), then
checks the threadpool again. If the threadpool is empty, everything is
fine. If not, it prints a message (to stdout) to inform the impatient
user why the test is probably hanging.
When test_scripts ran two clients at the same time, an error in one
could leave the other hanging (in a thread). One Deferred would errback,
the other would hang. Tests wait on one Deferred at a time, so if we're
unlucky and were waiting on the hanging Deferred (instead of the
erroring one), we'll wait forever, or at least until the default test
timeout of 180 seconds.
This adds an errback to notice when either client has errored, and
cancels the other Deferred, so it doesn't matter which one we wait upon
first.
The .appveyor.yml tells the tox.ini to install pypiwin32 directly,
rather than through a "twisted[windows]" extra. I wasn't able to get the
"extra" syntax to work properly under appyeyor, even though it worked ok
for me locally.
We use an extra "meta" tox environment to run "wormhole --version". This
confirms that versioneer is getting the right value, since we're now
running it from an installed sdist, rather than a checked-out git source
tree.
'readline' is part of the python stdlib, so declaring a dependency on it
doesn't help. It doesn't exist on windows, and the pypi 'readline'
module doesn't work on windows. So instead, just attempt to import
readline, and if that fails, fall back to a non-completion flavor.
This ensures that we'll be ready for them. Previously there was a race
between us revealing the direct hints to the peer, and us setting the
transit key (thus allowing us to check inbound handshake requests). The
Transit instance didn't handle the race, causing errors to be thrown
when the other side connected quickly.