Opened 6 months ago

Last modified 5 months ago

#30243 new defect

Stem's tests use fixed ports for tor, which may already be in use

Reported by: teor Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords: tor-ci-single-failure
Cc: Actual Points:
Parent ID: #29437 Points:
Reviewer: Sponsor: Sponsor31-can

Description

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.)

Child Tickets

Change History (4)

comment:1 Changed 6 months ago by atagar

Hi teor. Sure, we could use a random port if you'd like. I'll do so when I have some time (though happy to prioritize if this is urgent at all).

comment:2 in reply to:  1 Changed 6 months ago by teor

Replying to atagar:

Hi teor. Sure, we could use a random port if you'd like. I'll do so when I have some time (though happy to prioritize if this is urgent at all).

I have only ever seen it once, so we can do it eventually.

It probably happened due to a simultaneous #30235. So let's focus on #30235 and tor's logs.

comment:3 Changed 6 months ago by teor

Keywords: tor-ci-single-failure added; tor-ci-fail-sometimes removed

comment:4 Changed 5 months ago by teor

Sponsor: Sponsor31-can

Setting as sponsor 31 can, because we use these jobs to make sure our refactoring works.

Note: See TracTickets for help on using tickets.