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_get_cpu_times is failing on FreeBSD and OS X #40

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

test_get_cpu_times is failing on FreeBSD and OS X #40

giampaolo opened this issue May 23, 2014 · 4 comments

Comments

@giampaolo
Copy link
Owner

From [email protected] on March 17, 2009 02:34:05

======================================================================
FAIL: test_get_cpu_times (__main__.LimitedUserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 82, in test_get_cpu_times
    self.fail("expected: %s, found: %s" %(utime, user_time))
AssertionError: expected: 0.233333333333, found: 0.111669

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

If I'm not mistaken Jay should have told me that the culprit is os.times()
implementation which is buggy on FreeBSD.
If so it would make sense disabling the test for FreeBSD and file a new
report on the Python bug tracker.

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

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

From [email protected] on March 17, 2009 06:36:05

os.times() on FreeBSD is using the "HZ" constant instead of CLOCKS_PER_SEC. Since HZ
is not defined on FreeBSD, it's falling back on the default value of 60 for the posix
module, which is not correct for FreeBSD. CLOCKS_PER_SEC at least on my machine is
128, so the value calculated using HZ=60 is incorrect.

@giampaolo
Copy link
Owner Author

From [email protected] on March 20, 2009 14:01:21

Heh, turns out this is already a bug that's been identified and patched: 
http://bugs.python.org/issue1040026 So we'll just work around it in the test suite for affected platforms (so far OS X
and FreeBSD are both affected).

@giampaolo
Copy link
Owner Author

From [email protected] on March 20, 2009 14:43:47

Test disabled for OS X and FreeBSD as r273 .
Closing this out as Invalid.

Summary: test_get_cpu_times is failing on FreeBSD and OS X
Status: Invalid
Labels: OpSys-OSX OpSys-FreeBSD

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:47:39

Updated csets after the SVN -> Mercurial migration: r273 == revision a967b8382ce8

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