Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_pyrepl: test_not_wiping_history_file() fails (randomly?) on multiple buildbots #121351

Open
vstinner opened this issue Jul 3, 2024 · 6 comments
Labels
tests Tests in the Lib/test dir topic-repl Related to the interactive shell

Comments

@vstinner
Copy link
Member

vstinner commented Jul 3, 2024

Example with s390x Fedora 3.x: https://buildbot.python.org/all/#/builders/223/builds/6180

FAIL: test_not_wiping_history_file (test.test_pyrepl.test_pyrepl.TestMain.test_not_wiping_history_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/test_pyrepl/test_pyrepl.py", line 916, in test_not_wiping_history_file
    self.assertNotEqual(pathlib.Path(hfile.name).stat().st_size, 0)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 == 0

Failure seen on:

Linked PRs

@vstinner vstinner added tests Tests in the Lib/test dir topic-repl Related to the interactive shell labels Jul 3, 2024
@smontanaro
Copy link
Contributor

I've been seeing test_pyrepl errors for a week or so now. I see the above and a failure in test_exposed_globals_in_repl on M1 Mac and my old Dell running Ubuntu. Happy to provide more details if needed, but it sounds like this is a fairly widespread problem.

Mac output:

Re-running test_pyrepl in verbose mode (matching: test_exposed_globals_in_repl, test_not_wiping_history_file)
test_exposed_globals_in_repl (test.test_pyrepl.test_pyrepl.TestMain.test_exposed_globals_in_repl) ... FAIL
test_not_wiping_history_file (test.test_pyrepl.test_pyrepl.TestMain.test_not_wiping_history_file) ... FAIL

======================================================================
FAIL: test_exposed_globals_in_repl (test.test_pyrepl.test_pyrepl.TestMain.test_exposed_globals_in_repl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/skip/src/python/cpython/Lib/test/support/__init__.py", line 2622, in wrapper
    return func(*args, **kwargs)
  File "/Users/skip/src/python/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 868, in test_exposed_globals_in_repl
    self.assertTrue(case1 or case2 or case3 or case4, output)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true : sorted(dir())
io.FileIO name='/var/folders/d6/rzq9g7qd7zn5pwbc3pj1sthc0000gn/T/test_python_tk38j3o9/tmp8nzxvwmu' mode='rb+' closefd=True>
  gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
test test_pyrepl failed
1 test failed again:
    test_pyrepl

Dell (Ubuntu) output:

Re-running test_pyrepl in verbose mode (matching: test_exposed_globals_in_repl, test_not_wiping_history_file)
test_exposed_globals_in_repl (test.test_pyrepl.test_pyrepl.TestMain.test_exposed_globals_in_repl) ... FAIL
test_not_wiping_history_file (test.test_pyrepl.test_pyrepl.TestMain.test_not_wiping_history_file) ... FAIL

======================================================================
FAIL: test_exposed_globals_in_repl (test.test_pyrepl.test_pyrepl.TestMain.test_exposed_globals_in_repl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/skip/src/python/cpython/Lib/test/support/__init__.py", line 2622, in wrapper
    return func(*args, **kwargs)
  File "/home/skip/src/python/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 868, in test_exposed_globals_in_repl
    self.assertTrue(case1 or case2 or case3 or case4, output)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true : sorted(dir())
exit

Python 3.14.0a0 (heads/main:94f50f8ee68, Jul  3 2024, 16:43:33) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.


>>> 

>>> s

>>> so
>>> sor
>>> sort
>>> sorte
>>> sorted


>>> sorted(
>>> sorted(d

>>> sorted(di
>>> sorted(dir
>>> sorted(dir(
>>> sorted(dir()
>>> sorted(dir())



['__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__ior__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__or__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__ror__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values']


>>> 

>>> e

>>> ex
>>> exi
>>> exit





======================================================================
FAIL: test_not_wiping_history_file (test.test_pyrepl.test_pyrepl.TestMain.test_not_wiping_history_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/skip/src/python/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 913, in test_not_wiping_history_file
    self.assertEqual(exit_code, 0)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: 1 != 0

----------------------------------------------------------------------
Ran 2 tests in 1.149s

FAILED (failures=2)
/home/skip/src/python/cpython/Lib/test/support/__init__.py:813: ResourceWarning: unclosed file <_io.FileIO name='/tmp/test_python_arl58hui/tmpp21h4toz' mode='rb+' closefd=True>
  gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
test test_pyrepl failed
1 test failed again:
    test_pyrepl
@vstinner
Copy link
Member Author

vstinner commented Jul 4, 2024

I see the above and a failure in test_exposed_globals_in_repl on M1 Mac and my old Dell running Ubuntu. Happy to provide more details if needed, but it sounds like this is a fairly widespread problem.

Please open a separated issue for test_exposed_globals_in_repl(). See also #121206.

@smontanaro
Copy link
Contributor

Please open a separated issue for test_exposed_globals_in_repl(). See also #121206.

Yes, I saw that before. I opened a new issue:

#121359

@skirpichev
Copy link
Contributor

skirpichev commented Jul 6, 2024

That means, that #121245 is not fixed on some systems.

Edit:

randomly?

@vstinner, is there examples of such failures AND successes on same buildbot?

I'm working on this.

@skirpichev
Copy link
Contributor

Example with s390x Fedora 3.x: https://buildbot.python.org/all/#/builders/223/builds/6180

In this example: "checking for stdlib extension module readline... missing". Unless I miss something, it's valid for other cases too, e.g.:
https://buildbot.python.org/all/#/builders/1481/builds/288

As a workaround, I suggest to disable test if readline module is missing.

@skirpichev
Copy link
Contributor

FYI, pr is ready: #121422

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-repl Related to the interactive shell
3 participants