[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-18 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I disabled indexing and antivirus and I didn't see anything else obvious that 
would access the files, but I'm probably missing something -- I get the same 
intermittent failure when I build from the source at the 3.8.2 release, but not 
on a copy of 3.8.2 from python.org, so it's probably some setting that I don't 
know about for the repo folder. I think perhaps this isn't a real issue but 
rather me just not knowing the goings-on of my OS. :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-17 Thread Steve Dower


Steve Dower  added the comment:

Presumably you have something else on your system accessing the file.

Can you try disabling any file sync, anti-malware or indexing tools and see if 
that helps?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-16 Thread Dennis Sweeney


New submission from Dennis Sweeney :

I get the following intermittent failure when running the tests on Master on 
Windows 10.

=
=
=


PS C:\...\cpython> .\python.bat -m unittest -v 
test.test_os.TestScandir.test_attributes
Running Release|Win32 interpreter...
test_attributes (test.test_os.TestScandir) ... ok

--
Ran 1 test in 0.005s

OK
PS C:\...\cpython> .\python.bat -m unittest -v 
test.test_os.TestScandir.test_attributes
Running Release|Win32 interpreter...
test_attributes (test.test_os.TestScandir) ... FAIL

==
FAIL: test_attributes (test.test_os.TestScandir)
--
Traceback (most recent call last):
  File "C:\...\cpython\lib\test\test_os.py", line 3900, in test_attributes
self.check_entry(entry, 'link_file.txt', False, True, False)
  File "C:\...\cpython\lib\test\test_os.py", line 3861, in check_entry
self.assert_stat_equal(entry.stat(),
  File "C:\...\cpython\lib\test\test_os.py", line 3822, in assert_stat_equal
self.assertEqual(getattr(stat1, attr),
AssertionError: 1587065935.7958326 != 1587065935.79683 : 
(os.stat_result(st_mode=33206, st_ino=0, st_dev=0, st_nlink=0, st_uid=0, 
st_gid=0, st_size=6, st_atime=1587065935, st_mtime=1587065935, 
st_ctime=1587065935), os.stat_result(st_mode=33206, st_ino=2533274791602992, 
st_dev=839545721, st_nlink=2, st_uid=0, st_gid=0, st_size=6, 
st_atime=1587065935, st_mtime=1587065935, st_ctime=1587065935), 'st_atime')

--
Ran 1 test in 0.007s

FAILED (failures=1)

=
=
=


The failure seems to happen only about one in every 3 or 4 runs. Maybe this is 
unrelated, but I'm a little confused about why the repr of os.stat_result makes 
it look like st_atime is an int, but when accessing with .st_atime, we get a 
float that seems to just be st_atime_ns * 10**-9. I ran pdb during the failing 
test and got this:


=
=
=

-> self.assertEqual(getattr(stat1, attr),
(Pdb) stat1
os.stat_result(st_mode=33206, st_ino=0, st_dev=0, st_nlink=0, st_uid=0, 
st_gid=0, st_size=6, st_atime=1587071882, st_mtime=1587071882, 
st_ctime=1587071882)
(Pdb) stat1
os.stat_result(st_mode=33206, st_ino=0, st_dev=0, st_nlink=0, st_uid=0, 
st_gid=0, st_size=6, st_atime=1587071882, st_mtime=1587071882, 
st_ctime=1587071882)
(Pdb) stat1.st_atime == stat2.st_atime
False
(Pdb) stat1.st_atime
1587071882.6492443
(Pdb) stat2.st_atime
1587071882.6502416
(Pdb) stat1.st_atime_ns
1587071882649244400
(Pdb) stat2.st_atime_ns
1587071882650241700
(Pdb) dir(stat1)
['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', 
'__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', 
'__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', 
'__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__module__', 
'__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', 
'__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 
'count', 'index', 'n_fields', 'n_sequence_fields', 'n_unnamed_fields', 
'st_atime', 'st_atime_ns', 'st_ctime', 'st_ctime_ns', 'st_dev', 
'st_file_attributes', 'st_gid', 'st_ino', 'st_mode', 'st_mtime', 'st_mtime_ns', 
'st_nlink', 'st_reparse_tag', 'st_size', 'st_uid']
(Pdb) dir(stat2)
['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', 
'__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', 
'__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', 
'__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__module__', 
'__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', 
'__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 
'count', 'index', 'n_fields', 'n_sequence_fields', 'n_unnamed_fields', 
'st_atime', 'st_atime_ns', 'st_ctime', 'st_ctime_ns', 'st_dev', 
'st_file_attributes', 'st_gid', 'st_ino', 'st_mode', 'st_mtime', 'st_mtime_ns', 
'st_nlink', 'st_reparse_tag', 'st_size', 'st_uid']
(Pdb) tuple(stat1)
(33206, 0, 0, 0, 0, 0, 6, 1587071882, 1587071882, 1587071882)
(Pdb) tuple(stat2)
(33206, 9851624185502411, 839545721, 2, 0, 0, 6, 1587071882, 1587071882, 
1587071882)
(Pdb)

=
=
=

--
components: Windows
messages: 366631
nosy: Dennis Sweeney, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Intermittent failure of test_os.TestScandir.test_attributes on Windows
type: behavior
versions: Python