Stem's tests use fixed ports for tor, which may already be in use
Can stem choose a random (ideally unused) port instead? I thought Travis should virtualise all the ports, but maybe that doesn't work as well as it should?
======================================================================
FAIL: test_launch_tor_with_config_via_stdin
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/torproject/tor/stem/stem/util/test_tools.py", line 152, in <lambda>
self.method = lambda test: self.result(test) # method that can be mixed into TestCases
File "/home/travis/build/torproject/tor/stem/stem/util/test_tools.py", line 227, in result
test.fail(self._result.msg)
AssertionError: Traceback (most recent call last):
File "/home/travis/build/torproject/tor/stem/stem/util/test_tools.py", line 169, in _wrapper
runner(*args) if args else runner()
File "/home/travis/build/torproject/tor/stem/test/integ/process.py", line 502, in test_launch_tor_with_config_via_stdin
completion_percent = 5
File "/home/travis/build/torproject/tor/stem/stem/process.py", line 285, in launch_tor_with_config
return launch_tor(tor_cmd, ['-f', '-'], None, completion_percent, init_msg_handler, timeout, take_ownership, close_output, stdin = config_str)
File "/home/travis/build/torproject/tor/stem/stem/process.py", line 158, in launch_tor
raise OSError('Process terminated: %s' % last_problem)
OSError: Process terminated: Failed to bind one of the listener ports.
----------------------------------------------------------------------
Ran 22 tests in 11.493s
FAILED (failures=1)
https://travis-ci.org/torproject/tor/jobs/521109161#L3633
I've only seen this error once. So if it doesn't happen again, maybe we should just write it off as a once-off thing.
(Also, it might happen a lot more often when a tor process has hung due to #30235 (closed).)