Opened 3 years ago

Closed 3 years ago

#20477 closed defect (fixed)

stem cwd tests fail on macOS Sierra

Reported by: teor Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I see the following stem tests fail:

test_cwd                                                     [FAILURE]
test_cwd_lsof                                                [FAILURE]
======================================================================
FAIL: test_cwd
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/twilsonb/tor/stem/test/integ/util/system.py", line 394, in test_cwd
    self.assertEqual(tor_cwd, stem.util.system.cwd(runner_pid))
AssertionError: '/Users/twilsonb/tor/tor-master' != None

======================================================================
FAIL: test_cwd_lsof
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/twilsonb/tor/stem/test/integ/util/system.py", line 447, in test_cwd_lsof
    self.assertEqual(tor_cwd, stem.util.system.cwd(runner_pid))
AssertionError: '/Users/twilsonb/tor/tor-master' != None

----------------------------------------------------------------------

I wonder if it's because I am on macOS 10.12. Or something else about my environment. I used "STEM_SOURCE_DIR=../stem make test-full".

Child Tickets

Change History (6)

comment:1 Changed 3 years ago by atagar

Interesting! Stem's cwd util certainly should work on OSX. Iirc pwdx isn't present but lsof should work. What do you get when you run the following?

% pwdx [tor_pid]
% lsof -a -p [tor_pid] -d cwd -Fn

comment:2 Changed 3 years ago by teor

$ lsof -a -p 92599 -d cwd -Fn
p92599
fcwd
n/Users/twilsonb

Where the 3rd line shows the correct cwd.

comment:3 Changed 3 years ago by teor

(pwdx does not exist)

comment:4 Changed 3 years ago by atagar

Resolution: fixed
Status: newclosed

Thanks! Fix pushed, feel free to reopen if that doesn't do the trick.

comment:5 Changed 3 years ago by cypherpunks

Resolution: fixed
Status: closedreopened

The change in the test creates a duplicate dictionary key. Found using flake8.

test/unit/util/system.py:364:7: F999 dictionary key '75717' repeated with different values
test/unit/util/system.py:365:7: F999 dictionary key '75717' repeated with different values

comment:6 Changed 3 years ago by atagar

Resolution: fixed
Status: reopenedclosed

Oops, thanks for the catch! Fixed.

Note: See TracTickets for help on using tickets.