Opened 3 years ago

Closed 3 years ago

#22367 closed defect (fixed)

test.integ.process seems to expect a tor binary in $PATH

Reported by: catalyst Owned by: atagar
Priority: Medium Milestone:
Component: Archived/Stem Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: #22301 Points:
Reviewer: Sponsor:


test.integ.process seems to expect to find a system tor binary in $PATH. This is probably not intended (and if it is, it should be clearly documented). This prevents the tests from working on a system with no tor binary in the $PATH, which is a configuration I think we should support.

I tried to create an alternative way to replicate this failure by putting a shell script called tor in a directory by itself at the head of my $PATH that just does a kill -ABRT $$ but that caused test.integ.version.TestVersion to fail instead (and test.integ.process to succeed, oddly enough). Maybe the only way to reliably replicate this is by removing (or renaming) the system tor.

tlyu@arcadia:~/src/stem$ ./ --tor `pwd`/../tor/src/or/tor --all --log notice --target RUN_ALL

produces errors like

ERROR: test_no_orphaned_process
Traceback (most recent call last):
  File "/home/tlyu/src/stem/test/", line 58, in wrapped
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mock/", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/tlyu/src/stem/test/integ/", line 210, in test_no_orphaned_process
  File "/home/tlyu/src/stem/stem/", line 98, in launch_tor
    raise OSError("'%s' isn't available on your system. Maybe it's not in your PATH?" % tor_cmd)
OSError: 'tor' isn't available on your system. Maybe it's not in your PATH?

Ran 21 tests in 0.972s

FAILED (errors=1, skipped=7)

Child Tickets

Change History (2)

comment:1 Changed 3 years ago by atagar

Interesting. I'm not sure why this isn't reproing for me but I definitely see the issue. One sec, whipping up a fix.

comment:2 Changed 3 years ago by atagar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.