kiranvizru / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

VMS test faiulre on Windows 7 #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
======================================================================
FAIL: test_process_vms_memory (_windows.WindowsSpecificTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\pyftpdlib\svn\psutil\test\_windows.py", line 97, in test_process_vms_
memory
    self.assertEqual(vms, int(w.PageFileUsage))
AssertionError: 3727360 != 3640

----------------------------------------------------------------------
Ran 58 tests in 24.999s

FAILED (failures=1)

This happens on Windows 7 64 bit while on Windows XP everything is fine.
The interesting thing is that 3727360 / 1024 = 3640, so it seems that either 
WMI or our code is wrong.

Original issue reported on code.google.com by g.rodola on 21 Sep 2010 at 5:53

GoogleCodeExporter commented 9 years ago
WMI docs for Win32_Process class 
http://msdn.microsoft.com/en-us/library/aa394372(VS.85).aspx

-----
*PageFileUsage*
Data type: uint32
Access type: Read-only
Qualifiers: Units (Kilobytes)

Amount of page file space that a process is using currently. This value is 
consistent with the VMSize value in TaskMgr.exe.

Example: 102435
-----

So it looks like WMI is reporting kilobytes, not bytes. We'll need to either 
convert our bytes to kilobytes, or convert the WMI results into bytes for 
comparison.

Original comment by jlo...@gmail.com on 21 Sep 2010 at 5:57

GoogleCodeExporter commented 9 years ago
Problem seems to be that apparently WMI on Windows XP reports bytes while on 
Windows 7 reports kilo bytes.

Original comment by g.rodola on 21 Sep 2010 at 6:05

GoogleCodeExporter commented 9 years ago
Since I have no clue on why this happens I used a workaround in the test suite 
(r637) which now assumes Kb on Windows 7 and bytes on all other systems.

Original comment by g.rodola on 21 Sep 2010 at 6:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Updated csets after the SVN -> Mercurial migration:
r637 == revision 15c646a51f73

Original comment by g.rodola on 2 Mar 2013 at 11:54