Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/test_psutil.py status, psutil-0.7.1 #379

Closed
giampaolo opened this issue May 23, 2014 · 10 comments
Closed

test/test_psutil.py status, psutil-0.7.1 #379

giampaolo opened this issue May 23, 2014 · 10 comments

Comments

@giampaolo
Copy link
Owner

From IDela...@irelandxo.com on May 12, 2013 18:29:38

What steps will reproduce the problem?  
1. run test/test_psutil.py 2. 3. 

What is the expected output?  


What do you see instead?  


What version of psutil are you using? What Python version?  
-0.7.1; Python 2.7.3, pypy-2.0b2 

On what operating system? Is it 32bit or 64bit version?  
gentoo linux amd64 

Please provide any additional information below.  
pypy2_0: running

yields

Ran 106 tests in 16.831s

FAILED (failures=6, errors=5)

python2_7: running

yields

Ran 106 tests in 11.553s

FAILED (failures=6, errors=3)


I think some of these are expected fails, is so can you unittest deocate them 
as expected Failures??

So many failures the test run has been restricted

Attachment: psutil-0.7.1_build.log

Original issue: http://code.google.com/p/psutil/issues/detail?id=379

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From g.rodola on May 12, 2013 16:28:52

I tried to address all the failures reported in the log as of: revision 
24f293c9751e revision 70d013af2da2 revision 73e65535bbf5 revision b297c7baf424 
(most important)
Can you try to re-run tests with latest HG revision and report back?

@giampaolo
Copy link
Owner Author

From floppymaster@gmail.com on May 12, 2013 17:23:25

tests/_posix.py needs to import test_psutil.retry_before_failing.

diff --git a/test/_posix.py b/test/_posix.py
--- a/test/_posix.py
+++ b/test/_posix.py
@@ -17,7 +17,7 @@

 from psutil._compat import PY3
 from test_psutil import (get_test_subprocess, reap_children, PYTHON, LINUX, OSX,
-                         BSD, skip_on_access_denied, sh, skipIf)
+                         BSD, skip_on_access_denied, sh, skipIf, 
retry_before_failing)


 def ps(cmd):

@giampaolo
Copy link
Owner Author

From floppymaster@gmail.com on May 12, 2013 17:27:50

After making that change, I get this error with linux-3.8.4 and 3.9.2.

======================================================================
ERROR: test_as_dict (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 1570, in test_as_dict
    d = p.as_dict()
  File 
"/home/floppym/src/psutil/build/lib.linux-x86_64-2.7/psutil/__init__.py", line 
211, in as_dict
    ret = attr()
  File 
"/home/floppym/src/psutil/build/lib.linux-x86_64-2.7/psutil/__init__.py", line 
657, in get_memory_maps
    for tupl in it:
  File 
"/home/floppym/src/psutil/build/lib.linux-x86_64-2.7/psutil/_pslinux.py", line 
637, in get_memory_maps
    for header, data in get_blocks():
  File 
"/home/floppym/src/psutil/build/lib.linux-x86_64-2.7/psutil/_pslinux.py", line 
633, in get_blocks
    data[fields[0]] = int(fields[1]) * 1024
ValueError: invalid literal for int() with base 10: 'mr'


% grep mr /proc/self/smaps
VmFlags: rd ex mr mw me dw
VmFlags: rd mr mw me dw ac
...

@giampaolo
Copy link
Owner Author

From IDela...@irelandxo.com on May 12, 2013 19:15:21

This is looking better.
cloned the hg repo, added the import found by the floppy one in #2, 
+ 1 minor change;   the ps name made was gvfs-gdu-volume-monitor, however the 
actual file in /usr/libexec is gvfs-udisks2-volume-monitor, I suspect a name 
change in the most recent version gnome-base/gvfs and it's picking up an old 
name, otherwise add that to the list of required fixes.  I made a symlink for 
it in /usr/libexec and it found it and passed.


py2.7
/psutil $ sudo PYTHONPATH=./build/lib.linux-x86_64-2.7/ python 
test/test_psutil.py 


----------------------------------------------------------------------
Ran 187 tests in 5.525s

OK
test/test_psutil.py:83: RuntimeWarning: 
'TestFetchAllProcesses.test_get_io_counters' was skipped because not implemented
  warnings.warn(msg, warntype)
test/test_psutil.py:83: RuntimeWarning: 'test_get_io_counters' was skipped 
because it raised NotImplementedError
  warnings.warn(msg, warntype)


pypy
/psutil $ sudo PYTHONPATH=./build/lib.linux-x86_64-2.7/ pypy-c2.0 
test/test_psutil.py 

======================================================================
ERROR: test_disks (_linux.LinuxSpecificTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/testuser/bitBuckett/psutil/test/test_psutil.py", line 254, in wrapper
    return fun(*args, **kwargs)
  File "/home/testuser/bitBuckett/psutil/test/_linux.py", line 52, in test_disks
    usage = psutil.disk_usage(part.mountpoint)
  File 
"/home/testuser/bitBuckett/psutil/build/lib.linux-x86_64-2.7/psutil/__init__.py",
 line 1180, in disk_usage
    return _psplatform.get_disk_usage(path)
  File 
"/home/testuser/bitBuckett/psutil/build/lib.linux-x86_64-2.7/psutil/_psposix.py",
 line 99, in get_disk_usage
    st = os.statvfs(path)
AttributeError: 'module' object has no attribute 'statvfs'

----------------------------------------------------------------------
Ran 187 tests in 8.250s

FAILED (errors=1)


py3.2
psutil $ sudo PYTHONPATH=./build/lib.linux-x86_64-3.2/ python3.2 
test/test_psutil.py 

----------------------------------------------------------------------
Ran 187 tests in 6.793s

OK
test/test_psutil.py:83: RuntimeWarning: 
'TestFetchAllProcesses.test_get_io_counters' was skipped because not implemented
  warnings.warn(msg, warntype)
test/test_psutil.py:83: RuntimeWarning: 'test_get_io_counters' was skipped 
because it raised NotImplementedError
  warnings.warn(msg, warntype)

I could do more python versions but that should do the trick.

@giampaolo
Copy link
Owner Author

From g.rodola on May 13, 2013 03:56:49

Remaining failures fixed as of revision 2ecd58e2f0ea .
As for this one:

get_memory_maps
ValueError: invalid literal for int() with base 10: 'mr'

...it is tracked in issue 369 and I will fix that separately.
Closing this out for now and thanks for signaling.

Status: FixedInHG
Labels: Milestone-0.7.2

@giampaolo
Copy link
Owner Author

From IDela...@irelandxo.com on May 13, 2013 04:13:50

I did more.
results vary from run to run under pypy which I'd guess isn't a priority.
The above;


Python 2.7.3 (4b60269153b5b10c69155b6270bcce7a31a86281, May 10 2013, 02:23:28)
[PyPy 2.0.0-beta2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``first they laugh at you, then
they ignore you, then they fight you, then you win''
>>>> import sys
>>>> import os
>>>> os.statvfs
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'module' object has no attribute 'statvfs'
>>>> 

would warrant a  skip if sys.version_info has attr pypy or such.  From an 
ebuild I also had to change @skipIf(POSIX and not hasattr(os, 'statvfs'), ->
@skipIf(POSIX or not hasattr(os, 'statvfs'),  for def test_disk_usage

Python3 all trip over test_deprecated_apis_retval

=====================================================================
FAIL: test_deprecated_apis_retval (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 418, in test_deprecated_apis_retval
    self.assertEqual(psutil.get_process_list(), list(psutil.process_iter()))
AssertionError: Lists differ: [<psutil.Process(pid=1, name='... != 
[<psutil.Process(pid=1, name='...

First differing element 171:
psutil.Process(pid=30957 (terminated))
psutil.Process(pid=31472, name='python3.1')

First list contains 2 additional elements.
First extra element 179:
psutil.Process(pid=32232, name='emerge')

Diff is 12334 characters long. Set self.maxDiff to None to see it.

----------------------------------------------------------------------
Ran 106 tests in 4.910s

FAILED (failures=1)
test/test_psutil.py:83: RuntimeWarning: 
'TestFetchAllProcesses.test_get_io_counters' was skipped because not implemented
  warnings.warn(msg, warntype)
test/test_psutil.py:83: RuntimeWarning: 'test_get_io_counters' was skipped 
because it raised NotImplementedError
  warnings.warn(msg, warntype)
test/test_psutil.py:83: RuntimeWarning: Couldn't run limited user tests 
(super-user privileges are required)
  warnings.warn(msg, warntype)

@giampaolo
Copy link
Owner Author

From IDela...@irelandxo.com on May 13, 2013 10:53:48

right, seeing you entered "Remaining failures fixed as of.. " 17 minutes prior 
to my last entry, I finish off with this one final note.  

Recant on having to change @skipIf(POSIX and not hasattr(os, 'statvfs'), ->
@skipIf(POSIX or not hasattr(os, 'statvfs'),  for def test_disk_usage for pypy. 
 Instead pypy also trips over test_deprecated_apis_retval, making most of these 
bugs fixed but for these last few that bit too late.

@giampaolo
Copy link
Owner Author

From g.rodola on May 13, 2013 12:57:30

Issue 381 has been merged into this issue.

@giampaolo
Copy link
Owner Author

From g.rodola on June 08, 2013 05:23:24

Labels: -Milestone-0.7.2 Milestone-1.0.0

@giampaolo
Copy link
Owner Author

From g.rodola on July 11, 2013 01:54:35

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant