[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2022-04-02 Thread STINNER Victor
STINNER Victor added the comment: I close this issue as a duplicate of bpo-47089. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Avoid sporadic failure of test_compileall on Windows ___ Python tracker

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2022-04-02 Thread Jeremy Kloth
Jeremy Kloth added the comment: bpo-47089 is a duplicate of this issue and is fixed. This issue should be closed as well. -- ___ Python tracker ___

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-30 Thread Tim Peters
Tim Peters added the comment: Yes, test_compileall can still fail for this reason on Windows. From a run just now with -j0 (same as -j10 on this box, which has 8 logical cores: a -j value <= 0 is treated the same as "2 + number of logical cores"): """ Compiling

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-30 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: Ok -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: I proposed a way to fix the issue: "Maybe the test should copy all .py files of the stdlib into a temporary directory and work there, to not impact other tests run in parallel." Shreyan Avigyan: > Though I've never been able to reproduce this test failure.

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-30 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: Though I've never been able to reproduce this test failure. Maybe it's fixed (maybe it was a side effect of another test)? -- ___ Python tracker

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Eryk Sun
Eryk Sun added the comment: > What is the name of the new function introduced in Windows 10 NT API? > Should we use it if the version is detected as Windows 10 (through a > callback to a platform function or through GetVersion API)? No, _bootstrap_external._write_atomic() or

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: What is the name of the new function introduced in Windows 10 NT API? Should we use it if the version is detected as Windows 10 (through a callback to a platform function or through GetVersion API)? -- ___

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Eryk Sun
Eryk Sun added the comment: > I don't know enough about when and why CPython decides to > replace .pyc files It's straight-forward in the case of py_compile.compile(): >>> pyc = py_compile.compile('test.py') >>> f = open(pyc) >>> try: py_compile.compile('test.py') ...

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Tim Peters
Tim Peters added the comment: A "good" solution would be one that runs the test in such a way that it doesn't fail only on Windows ;-) There are presumably many ways that could be accomplished, including ugly ones. For example, if test_compileall is in the collection of tests to be run, and

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: What should we do? Should we skip test_compileall if the test suite is run in parallel? -- ___ Python tracker ___

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Tim Peters
Tim Peters added the comment: @Sheyvan, whether it's possible to delete (rename, etc) an open file is a property not of Python, but of the operating system. Windows doesn't allow it; Linux (for example) does. It's generally considered to be "a bug" in CPython's implementation whenever it

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: @vstinner What do you think? I'm not sure if there's a solution to this. -- ___ Python tracker ___

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: I don't think it's a bug at all. It's a feature of Python that's causing this. And since it's not a bug I don't think copying the files in temporary directory would help at all because Windows is not giving the error. Python is giving the error to Python

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: I've experienced that when a module is imported in the interpreter that module file (.py, .pyc, .pyd) cannot be deleted, renamed, rewritten, etc. When that session is closed only then the file can be deleted, renamed, rewritten, all that stuff. Running

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-28 Thread Guido van Rossum
Guido van Rossum added the comment: Well, in the normal course of running multiple Python programs on the same machine, pyc files may be rewritten, and this should not cause crashes. So perhaps there’s a real bug here? -- nosy: +Guido.van.Rossum

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2020-01-06 Thread STINNER Victor
STINNER Victor added the comment: x86 Windows7 3.8: https://buildbot.python.org/all/#/builders/223/builds/59 FAIL: test_no_args_respects_force_flag (test.test_compileall.CommmandLineTestsNoSourceEpoch) -- Traceback (most

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2019-06-24 Thread Jeremy Kloth
Change by Jeremy Kloth : -- nosy: +jkloth ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2019-06-24 Thread STINNER Victor
New submission from STINNER Victor : I'm not sure that it's a good practice to rewrite .pyc files of the stdlib while tests are run in parallel. Maybe the test should copy all .py files of the stdlib into a temporary directory and work there, to not impact other tests run in parallel.