classification
Title: test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x
Type: Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: erlendaasland, lukasz.langa, miss-islington, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2021-08-18 15:09 by vstinner, last changed 2021-09-14 11:17 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27813 merged vstinner, 2021-08-18 16:31
PR 27822 merged miss-islington, 2021-08-19 08:31
PR 27823 merged miss-islington, 2021-08-19 08:31
Messages (7)
msg399848 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-08-18 15:09
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')
----------------------------------------------------------------------
msg399851 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-08-18 15:46
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
msg399853 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-08-18 16:33
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.
msg399858 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-18 17:39
New changeset 6fb62b42f4db56ed5efe0ca4c1059049276c1083 by Victor Stinner in branch 'main':
bpo-44949: Fix test_readline auto history tests (#27813)
https://github.com/python/cpython/commit/6fb62b42f4db56ed5efe0ca4c1059049276c1083
msg399894 - (view) Author: miss-islington (miss-islington) Date: 2021-08-19 08:52
New changeset fc6ad0585e8133ee0fca05f0f8075b62fe71a95d by Miss Islington (bot) in branch '3.10':
bpo-44949: Fix test_readline auto history tests (GH-27813)
https://github.com/python/cpython/commit/fc6ad0585e8133ee0fca05f0f8075b62fe71a95d
msg399904 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-19 10:36
New changeset 0215257c613d55bec27201683f3dcb00f1726536 by Miss Islington (bot) in branch '3.9':
bpo-44949: Fix test_readline auto history tests (GH-27813) (GH-27822)
https://github.com/python/cpython/commit/0215257c613d55bec27201683f3dcb00f1726536
msg401776 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-09-14 11:17
Similar issue in test_readline.test_nonascii(): bpo-45195.
History
Date User Action Args
2021-09-14 11:17:05vstinnersetmessages: + msg401776
2021-08-19 13:33:03vstinnersetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.10, Python 3.11
2021-08-19 10:36:01lukasz.langasetmessages: + msg399904
2021-08-19 08:52:20miss-islingtonsetmessages: + msg399894
2021-08-19 08:31:31miss-islingtonsetpull_requests: + pull_request26288
2021-08-19 08:31:27miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request26287
2021-08-18 17:39:03lukasz.langasetmessages: + msg399858
2021-08-18 16:33:03vstinnersetmessages: + msg399853
2021-08-18 16:31:40vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request26278
2021-08-18 15:46:29vstinnersetmessages: + msg399851
2021-08-18 15:10:29vstinnersettitle: 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
2021-08-18 15:09:16vstinnercreate