classification
Title: test_site: test_s_option() failed on AMD64 Windows8.1 Refleaks 3.7
Type: Stage:
Components: Tests Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: corona10, pablogsal, shihai1991, terry.reedy, vstinner
Priority: normal Keywords:

Created on 2020-09-07 14:13 by vstinner, last changed 2020-10-27 03:21 by vstinner.

Messages (3)
msg376496 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-09-07 14:13
It's not the first time that I see this error, but it looks random:

* 2009-11-08: bpo-7283: "test_site failure when .local/lib/pythonX.Y/site-packages hasn't been created yet": x86-64 Ubuntu 14.04 ICC Debug 3.5, AppVeyor (Windows)
* 2017-11-20: bpo-32091: "test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6"
* 2018-07-21: bpo-34177: "test_site fails in macOS-PR VSTS builds for 3.7 branch"
* 2019-09-16: bpo-38184: "test_site: test_s_option() failed on AMD64 Fedora Rawhide Refleaks 2.7 and AMD64 Fedora Stable Refleaks 3.7"
* etc.

Usually, I close the issue since it only occurs once and then hides for 1 year...

---

AMD64 Windows8.1 Refleaks 3.7:
https://buildbot.python.org/all/#/builders/63/builds/21

0:50:59 load avg: 4.70 [345/416/1] test_site failed -- running: test_multiprocessing_spawn (9 min 23 sec), test_importlib (1 min 11 sec)
beginning 6 repetitions
123456
.test test_site failed -- Traceback (most recent call last):
  File "D:\buildarea\3.7.ware-win81-release.refleak\build\lib\test\test_site.py", line 205, in test_s_option
    self.assertIn(usersite, sys.path)
AssertionError: 'C:\\Users\\buildworker\\AppData\\Roaming\\Python\\Python37\\site-packages' not found in ['D:\\buildarea\\3.7.ware-win81-release.refleak\\build', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\PCbuild\\amd64\\python37_d.zip', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\DLLs', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\lib', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\PCbuild\\amd64', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\lib\\site-packages']
(...)
1:10:20 load avg: 0.08 Re-running test_site in verbose mode
beginning 6 repetitions
123456
......
beginning 6 repetitions
123456
test__getuserbase (test.test_site.HelperFunctionsTests) ... ok
(...)
test_no_home_directory (test.test_site.HelperFunctionsTests) ... ok
test_s_option (test.test_site.HelperFunctionsTests) ... FAIL
test_abs_paths (test.test_site.ImportSideEffectTests) ... ok
(...)
test_underpth_nosite_file (test.test_site._pthFileTests) ... ok

======================================================================
FAIL: test_s_option (test.test_site.HelperFunctionsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\buildarea\3.7.ware-win81-release.refleak\build\lib\test\test_site.py", line 205, in test_s_option
    self.assertIn(usersite, sys.path)
AssertionError: 'C:\\Users\\buildworker\\AppData\\Roaming\\Python\\Python37\\site-packages' not found in ['D:\\buildarea\\3.7.ware-win81-release.refleak\\build', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\PCbuild\\amd64\\python37_d.zip', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\DLLs', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\lib', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\PCbuild\\amd64', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build', 'D:\\buildarea\\3.7.ware-win81-release.refleak\\build\\lib\\site-packages']

----------------------------------------------------------------------

Ran 30 tests in 1.172s
(...)
msg379187 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-10-21 03:47
On Windows 10 and master, I ran 12 copies of test_site in parallel 10 times.  Then I ran -R 3:100 3 times.  All pass.  

Unless refleaks are considered security holes, perhaps this should be closed until it re-occurs in a normally maintained branch.
msg379723 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-10-27 03:21
> Unless refleaks are considered security holes,

This issue is unrelated to reference leak. It's just that when you run test_site multiple times, it fails sometimes. It looks like a race condition in the test.

My notes on unstable tests:
https://pythondev.readthedocs.io/unstable_tests.html


> On Windows 10 and master, I ran 12 copies of test_site in parallel 10 times.  Then I ran -R 3:100 3 times.  All pass.  

Maybe test_site only fails when other tests are run in parallel.
History
Date User Action Args
2020-10-27 03:21:42vstinnersetmessages: + msg379723
2020-10-21 03:47:27terry.reedysetnosy: + terry.reedy
messages: + msg379187
2020-09-08 11:18:21shihai1991setnosy: + shihai1991
2020-09-07 14:13:38vstinnercreate