Title: test_pydoc test_synopsis_sourceless is a flaky test
Type: behavior Stage: needs patch
Components: Tests Versions: Python 3.4
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.snow, gregory.p.smith, koobs
Priority: normal Keywords:

Created on 2014-11-21 07:03 by gregory.p.smith, last changed 2014-11-21 09:33 by gregory.p.smith.

Messages (2)
msg231465 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2014-11-21 07:03
When running a parallel make -j12 test, test_pydoc fails reasonably often with:

test test_pydoc failed -- Traceback (most recent call last):
  File "/.../Lib/test/", line 556, in test_synopsis_sourceless   
    synopsis = pydoc.synopsis(filename)
  File "/.../Lib/", line 240, in synopsis
    mtime = os.stat(filename).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/.../Lib/__pycache__/os.cpython-34.pyc'

Two other issues mention this failure as being introduced recently in comments: &
msg231469 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2014-11-21 09:33
I suspect flakiness is due to parallel test execution.  Is some other test possibly executing at the same time removing __pycache__ directories or .pyc files to recreate them (test_compileall?)?  If the test were adjusted to point to a .py file of its own that it generates in a temporary directory that would avoid that.
Date User Action Args
2014-11-21 09:33:49gregory.p.smithsetmessages: + msg231469
2014-11-21 09:31:03gregory.p.smithsetassignee: gregory.p.smith ->
2014-11-21 07:03:41gregory.p.smithcreate