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

Errors in test suite Windows 2003 SP2 #78

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

Errors in test suite Windows 2003 SP2 #78

giampaolo opened this issue May 23, 2014 · 7 comments

Comments

@giampaolo
Copy link
Owner

From jlo...@gmail.com on March 01, 2010 03:45:33

I'm getting some inconsistent errors in the test suite, mostly seems like
issues relating to wmi.py usage. I've tried upgrading the wmi.py and
pywin32 installations to the latest but that doesn't seem to help. Here's
two of the more consistent errors I've been getting: 

======================================================================
ERROR: test_NUM_CPUS (_windows.WindowsSpecificTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Projects\psutil\test\_windows.py", line 99, in test_NUM_CPUS
    self.assertEqual(w.NumberOfLogicalProcessors, psutil.NUM_CPUS)
  File "C:\Python25\Lib\site-packages\wmi.py", line 554, in __getattr__
    return getattr (self.ole_object, attribute)
  File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 512, in
__getattr__
    raise AttributeError("%s.%s" % (self._username_, attr))
AttributeError: <unknown>.NumberOfLogicalProcessors

======================================================================
FAIL: test_process_path (_windows.WindowsSpecificTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Projects\psutil\test\_windows.py", line 60, in test_process_path
    self.assertEqual(os.path.join(p.path, p.name), w.ExecutablePath)
AssertionError: 'C:\\Python25\\python.exe' != None

----------------------------------------------------------------------
Ran 50 tests in 16.531s

FAILED (failures=1, errors=1)

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

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

From jlo...@gmail.com on February 28, 2010 18:50:11

Number of CPUs test is going to fail on most platforms. From MSDN: 

NumberOfLogicalProcessors

    Data type: uint32
    Access type: Read-only

    Number of logical processors for the current instance of the processor. For
processors capable of hyperthreading, this value includes only the processors which
have hyperthreading enabled. For more information, see Remarks.

        Windows Server 2003, Windows XP, and Windows 2000:  This property is not
available.

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on February 28, 2010 19:00:40

Ok, I submitted changes to the test suite in r528 to fix the number of CPUs test. The
other test failures I'm seeing look like race condition issues, since they come and
go and different tests are failing each time. Based on the type of errors I'm seeing
it looks like WMI is unreliable for our purposes. Example error: 

======================================================================
ERROR: test_zombie_process (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test\test_psutil.py", line 383, in test_zombie_process
    self.assertRaises(psutil.NoSuchProcess, getattr, p, "username")
  File "C:\Python26\lib\unittest.py", line 336, in failUnlessRaises
    callableObj(*args, **kwargs)
  File "C:\Python26\lib\site-packages\psutil\__init__.py", line 239, in username
    self._procinfo.username =  _platform_impl.get_process_username(self.pid)
  File "C:\Python26\lib\site-packages\psutil\_psmswindows.py", line 112, in
get_process_username
    domain, _, username = w[0].GetOwner()
  File "C:\Python26\Lib\site-packages\wmi.py", line 427, in __call__
    handle_com_error ()
  File "C:\Python26\Lib\site-packages\wmi.py", line 241, in handle_com_error
    raise klass (com_error=err)
x_wmi: <x_wmi: Unexpected COM Error (-2147352567, 'Exception occurred.', (0, u'S
WbemObjectEx', u'Not found ', None, 0, -2147217406), None)>

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on March 01, 2010 07:54:58

Labels: Milestone-0.1.3

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on March 02, 2010 11:54:26

Labels: -Milestone-0.1.3

@giampaolo
Copy link
Owner Author

From g.rodola on October 26, 2010 05:52:07

What's the current status on this?
If we can't rely on Windows specific tests based on wmi.py I suggest to 
determine the Windows version at runtime and skip those tests if it's == Windows 2003.

Labels: -Progress-3in4

@giampaolo
Copy link
Owner Author

From g.rodola on November 11, 2010 15:46:11

Username error was fixed in issue 114 (get_username() rewritten in C).
Other errors were fixed in r788 , r789 .

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:51:58

Updated csets after the SVN -> Mercurial migration: r528 == revision 6bdee522b07f r788 == revision e6d690038eec

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