python / cpython

The Python programming language
https://www.python.org
Other
62.15k stars 29.86k forks source link

test_pyrepl: test_inspect_keeps_globals_from_inspected_file() fails on s390x Fedora 3.x #121952

Closed vstinner closed 1 month ago

vstinner commented 1 month ago

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

readline is missing. Maybe just skip the test if readine is missing?

cc @ambv @pablogamboa

The necessary bits to build these optional modules were not found:
readline

Examples:

test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) ... 
  test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='FOO', expected='42') ... FAIL
  test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='__name__', expected="'__main__'") ... FAIL
  test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='__package__', expected='None') ... FAIL
test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) ... 
  test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='FOO', expected='42') ... FAIL
  test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__name__', expected="'__main__'") ... FAIL
  test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__package__', expected="'blue'") ... FAIL
  test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__file__', expected=re.compile("^'.*calx.py'$")) ... FAIL

(...)

FAIL: test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='FOO', expected='42')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: FOO= not found in output

======================================================================
FAIL: test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='__name__', expected="'__main__'")
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __name__= not found in output

======================================================================
FAIL: test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='__package__', expected='None')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __package__= not found in output
pablogamboa commented 1 month ago

@vstinner think you meant @pablogsal !

colesbury commented 1 month ago

The test is flaky on other OS's as well: https://github.com/python/cpython/issues/121973. I put up https://github.com/python/cpython/pull/122140 that I believe addresses the flakiness.

I think think the issue is just the flakiness and not the missing readline library, but I'm not sure yet.

colesbury commented 1 month ago

I think this is fixed now by https://github.com/python/cpython/pull/122140