Opened 5 years ago

Closed 5 years ago

#6286 closed defect (fixed)

test.integ.util.proc tests fail (on linux)

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

Description

A few test.integ.util.proc tests fail on my machine (running Archlinux).
I get the following output.

======================================================================
                         test.integ.util.proc
======================================================================

test_get_connections                                         [FAILURE]
test_get_cwd                                                 [FAILURE]
test_get_memory_usage                                        [SUCCESS]
test_get_stats                                               [FAILURE]
test_get_uid                                                 [SUCCESS]

======================================================================
ERROR: test_get_connections
----------------------------------------------------------------------
Traceback:
  File "/home/neena/code/tors/stem/test/integ/util/proc.py", line 92, in test_get_connections
    for conn in proc.get_connections(tor_pid):
  File "/home/neena/code/tors/stem/stem/util/proc.py", line 281, in get_connections
    for fd in os.listdir("/proc/%s/fd" % pid):
OSError: [Errno 13] Permission denied: '/proc/4291/fd'

======================================================================
ERROR: test_get_cwd
----------------------------------------------------------------------
Traceback:
  File "/home/neena/code/tors/stem/test/integ/util/proc.py", line 26, in test_get_cwd
    self.assertEquals(tor_cwd, proc.get_cwd(runner_pid))
  File "/home/neena/code/tors/stem/stem/util/proc.py", line 141, in get_cwd
    raise exc
IOError: unable to read /proc/4291/cwd

======================================================================
ERROR: test_get_stats
----------------------------------------------------------------------
Traceback:
  File "/home/neena/code/tors/stem/test/integ/util/proc.py", line 66, in test_get_stats
    command, utime, stime, start_time = proc.get_stats(tor_pid, 'command', 'utime', 'stime', 'start time')
  File "/home/neena/code/tors/stem/stem/util/proc.py", line 238, in get_stats
    raise exc
IOError: stat file had an unexpected format: /proc/4291/stat

----------------------------------------------------------------------
Ran 5 tests in 0.021s

FAILED

I'll post more details after I attempt debugging it.

Child Tickets

Change History (3)

comment:1 Changed 5 years ago by neena

test_get_connections fails because

+11:49% ls -l
...
dr-x------ 2 root  root  0 Jul  3 23:43 fd
...

test_get_stats probably failing because my /proc/*/stat has 47 fields instead of 44

+11:46% cat stat
5269 (tor) S 5266 5266 4280 34824 5266 4202496 3417 0 0 0 220 8 0 0 20 0 1 0 2586787 15482880 2821 4294967295 1 1 0 0 0 0 0 0 16865795 4294967295 0 0 17 0 0 0 0 0 0 0 0 0

This is from stem.util.proc.get_stats
{{{ if len(stat_comp) != 44 and _is_float(stat_comp[13], stat_comp[14], stat_comp[21]):

exc = IOError("stat file had an unexpected format: %s" % stat_path)
_log_failure(parameter, exc)
raise exc

}}}

comment:2 Changed 5 years ago by atagar

Status: newneeds_information

Thanks, Ravi!

test_get_connections fails because

Fixed...
https://gitweb.torproject.org/stem.git/commitdiff/74597a7

test_get_stats probably failing because my /proc/*/stat has 47 fields instead of 44

Fixed...
https://gitweb.torproject.org/stem.git/commitdiff/6aa2074

Mind running the tests again with the RUN_ALL target to make sure that all is well now?

comment:3 in reply to:  2 Changed 5 years ago by neena

Resolution: fixed
Status: needs_informationclosed

Works.

Note: See TracTickets for help on using tickets.