Opened 6 years ago

Closed 6 years ago

#15449 closed defect (fixed)

test_is_running() fails on OSX

Reported by: corcra Owned by: atagar
Priority: Low Milestone:
Component: Archived/Stem Version:
Severity: Keywords: testing
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


On OSX, tor runs under the name tor.real (due to, but is started by calling tor, so this fails during testing:


(this is in stem/test/integ/util/

A possible workaround would be modifying the workaround for #10030 (it's workarounds all the way down) to use

exec -a tor ./tor.real "$@"

instead of

exec ./tor.real "$@"

and then changing the ps call in stem/stem/util/ to not use accounting, so it sees the process running as tor:

IS_RUNNING_PS_BSD = 'ps -ao comm='

instead of

IS_RUNNING_PS_BSD = 'ps -ao ucomm='

... but I'm not sure if turning off accounting is appropriate/desirable, and changing non-stem things just to fix a bug in stem tests seems like overkill.

The OSX 'weirdness' is already handled appropriately elsewhere in stem, so maybe this test should just be modified (like)

self.assertTrue(stem.util.system.is_running('tor') or stem.util.system.is_running('tor.real'))

or further upstream, set _tor_cmd in the runner in an OS-conscious manner?

Child Tickets

Change History (2)

comment:1 Changed 6 years ago by corcra

Keywords: testing added

comment:2 Changed 6 years ago by atagar

Resolution: fixed
Status: newclosed

Thanks corcra! Pushed a fix. I was a tad tempted to add a tor_tools.is_running() helper that accounts for both names but then realized this would be baking a hack into our library. Maybe I'm a dreamer but I'd like to think the hack will be dropped someday. :P

Note: See TracTickets for help on using tickets.