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_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x #89112

Closed
vstinner opened this issue Aug 18, 2021 · 8 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 bug and security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 44949
Nosy @vstinner, @ambv, @pablogsal, @miss-islington, @erlend-aasland
PRs
  • bpo-44949: Fix test_readline auto history tests #27813
  • [3.9] bpo-44949: Fix test_readline auto history tests (GH-27813) #27822
  • [3.10] bpo-44949: Fix test_readline auto history tests (GH-27813) #27823
  • [3.8] bpo-44949: Fix test_readline auto history tests (GH-27813) #31118
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-08-19.13:33:03.054>
    created_at = <Date 2021-08-18.15:09:16.445>
    labels = ['tests', '3.9', '3.10', '3.11']
    title = 'test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x'
    updated_at = <Date 2022-02-17.08:32:12.853>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2022-02-17.08:32:12.853>
    actor = 'lukasz.langa'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-08-19.13:33:03.054>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2021-08-18.15:09:16.445>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44949
    keywords = ['patch']
    message_count = 8.0
    messages = ['399848', '399851', '399853', '399858', '399894', '399904', '401776', '413391']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'lukasz.langa', 'pablogsal', 'miss-islington', 'erlendaasland']
    pr_nums = ['27813', '27822', '27823', '31118']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44949'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @vstinner
    Copy link
    Member Author

    test_readline fails randomly on aarc64 RHEL8 buildbots (3.9, 3.10 and 3.x).

    In some builds, test_readline fails but then pass when re-run in verbose mode. Example:
    https://buildbot.python.org/all/#/builders/41/builds/148
    ---
    0:02:56 load avg: 2.79 Re-running test_readline in verbose mode (matching: test_auto_history_disabled)
    test_auto_history_disabled (test.test_readline.TestReadline) ... ok
    ---

    aarch64 RHEL8 Refleaks 3.9:
    https://buildbot.python.org/all/#/builders/247/builds/107

    test.pythoninfo:

    readline._READLINE_LIBRARY_VERSION: 7.0
    readline._READLINE_RUNTIME_VERSION: 0x700
    readline._READLINE_VERSION: 0x700

    Tests:

    0:33:57 load avg: 0.93 Re-running test_readline in verbose mode (matching: test_auto_history_disabled)
    beginning 6 repetitions
    123456
    readline version: 0x700
    readline runtime version: 0x700
    readline library version: '7.0'
    use libedit emulation? False
    test test_readline failed
    test_auto_history_disabled (test.test_readline.TestReadline) ... FAIL
    ======================================================================
    FAIL: test_auto_history_disabled (test.test_readline.TestReadline)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-aarch64.refleak/build/Lib/test/test_readline.py", line 154, in test_auto_history_disabled
        self.assertIn(b"History length: 0\r\n", output)
    AssertionError: b'History length: 0\r\n' not found in bytearray(b'dummy input\r\ndummy input\r\nHistory length: 0')

    @vstinner vstinner added 3.9 only security fixes tests Tests in the Lib/test dir labels Aug 18, 2021
    @vstinner vstinner changed the title test_readline: test_auto_history_disabled() fails on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x Aug 18, 2021
    @vstinner vstinner changed the title test_readline: test_auto_history_disabled() fails on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x Aug 18, 2021
    @vstinner
    Copy link
    Member Author

    I failed to reproduce the issue on Fedora 34 (readline-8.1-2.fc34.i686).

    $ ./python -m test test_readline -m test_auto_history_disabled -j40 -F
    (...)
    0:19:35 load avg: 42.40 [10785] test_readline passed
    0:19:35 load avg: 42.40 [10786] test_readline passed
    0:19:35 load avg: 42.40 [10787] test_readline passed
    ^C
    Test suite interrupted by signal SIGINT.
    10787 tests OK.
    Total duration: 19 min 36 sec
    
    $ ./python -m test test_readline -j40 -F
    (...)
    0:03:30 load avg: 41.07 [1330] test_readline passed
    0:03:31 load avg: 41.07 [1331] test_readline passed
    ^C
    1331 tests OK.
    Total duration: 3 min 31 sec
    Tests result: INTERRUPTED

    @vstinner
    Copy link
    Member Author

    I ran the test manually on the buildbot worker. Sometimes, the test process gets the EIO error even before getting the 2 newline bytes (b"\r\n"). I wrote PR 27813 to simply not expect the newline character.

    Adding flush=True to the print("History length:", readline.get_current_history_length()) call in the Python script doesn't fix the issue.

    @ambv
    Copy link
    Contributor

    ambv commented Aug 18, 2021

    New changeset 6fb62b4 by Victor Stinner in branch 'main':
    bpo-44949: Fix test_readline auto history tests (bpo-27813)
    6fb62b4

    @miss-islington
    Copy link
    Contributor

    New changeset fc6ad05 by Miss Islington (bot) in branch '3.10':
    bpo-44949: Fix test_readline auto history tests (GH-27813)
    fc6ad05

    @ambv
    Copy link
    Contributor

    ambv commented Aug 19, 2021

    New changeset 0215257 by Miss Islington (bot) in branch '3.9':
    bpo-44949: Fix test_readline auto history tests (GH-27813) (GH-27822)
    0215257

    @vstinner vstinner added 3.10 only security fixes 3.11 bug and security fixes labels Aug 19, 2021
    @vstinner vstinner added 3.10 only security fixes 3.11 bug and security fixes labels Aug 19, 2021
    @vstinner
    Copy link
    Member Author

    Similar issue in test_readline.test_nonascii(): bpo-45195.

    @ambv
    Copy link
    Contributor

    ambv commented Feb 17, 2022

    New changeset b1bc04d by Miss Islington (bot) in branch '3.8':
    bpo-44949: Fix test_readline auto history tests (GH-27813) (GH-31118)
    b1bc04d

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 bug and security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants