diff mbox series

python3: skip readline limited history tests

Message ID 20240813153039.3395682-1-tgamblin@baylibre.com
State Accepted, archived
Commit de569ddffd5ea36b70c56df21dec9c892e5dee7d
Headers show
Series python3: skip readline limited history tests | expand

Commit Message

Trevor Gamblin Aug. 13, 2024, 3:30 p.m. UTC
Python 3.12.5 is failing a newer ptest for reading/writing limited
history. Skip it for now until a proper fix (if any) is determined.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
 ...t_readline-skip-limited-history-test.patch | 38 +++++++++++++++++++
 .../recipes-devtools/python/python3_3.12.5.bb |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3/0001-test_readline-skip-limited-history-test.patch

Comments

Alexander Kanavin Aug. 13, 2024, 3:47 p.m. UTC | #1
On Tue, 13 Aug 2024 at 17:30, Trevor Gamblin via
lists.openembedded.org <tgamblin=baylibre.com@lists.openembedded.org>
wrote:
> Python 3.12.5 is failing a newer ptest for reading/writing limited
> history. Skip it for now until a proper fix (if any) is determined.
> +This test was added recently and is failing on the ptest image. Disable
> +it until the proper fix is determined.

We should not be disabling tests without any investigation at all into
why they fail, just so some other functionality (e.g. version updates)
can merge into master. I have to say no to this. Please look into it.

If it was added recently, what was the commit that added it? Can you
add a link to that commit?

If it fails, what happens exactly? Where is the failure coming from?
Does the test expect something on the target image that isn't being
provided?

etc.

Alex
Trevor Gamblin Aug. 13, 2024, 4:27 p.m. UTC | #2
On 2024-08-13 11:47 a.m., Alexander Kanavin wrote:
> On Tue, 13 Aug 2024 at 17:30, Trevor Gamblin via
> lists.openembedded.org <tgamblin=baylibre.com@lists.openembedded.org>
> wrote:
>> Python 3.12.5 is failing a newer ptest for reading/writing limited
>> history. Skip it for now until a proper fix (if any) is determined.
>> +This test was added recently and is failing on the ptest image. Disable
>> +it until the proper fix is determined.
> We should not be disabling tests without any investigation at all into
> why they fail, just so some other functionality (e.g. version updates)
> can merge into master. I have to say no to this. Please look into it.
>
> If it was added recently, what was the commit that added it? Can you
> add a link to that commit?

It was added in 
https://github.com/python/cpython/commit/263c7e611bb24715e513d457a3477a61fff15162

The GitHub issue is here: https://github.com/python/cpython/issues/121160

>
> If it fails, what happens exactly? Where is the failure coming from?
> Does the test expect something on the target image that isn't being
> provided?
>
> etc.

The failure looks like:

FAIL: test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history)

======================================================================
ERROR: test_write_read_limited_history (test.test_readline.TestHistoryManipulation.test_write_read_limited_history)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/lib/python3.12/test/test_readline.py", line 153, in test_write_read_limited_history
     readline.read_history_file(TESTFN)
OSError: [Errno 22] Invalid argument

======================================================================
ERROR: test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/lib/python3.12/test/test_readline.py", line 362, in test_write_read_limited_history
     readline.read_history_file(TESTFN)
OSError: [Errno 22] Invalid argument

----------------------------------------------------------------------
Ran 11 tests in 0.266s

FAILED (errors=2, skipped=3)
test test_readline failed

It's not clear to me what the fix is, seems like maybe an issue with the 
readline available in python3 ptest images. I've looked at TESTFN and 
the HISTORY_FILE environment variable that the test is supposedly using. 
The aforementioned bug report suggests that OSErrors like that show up 
when using the GNU readline-based readline module if a workaround isn't 
also incorporated. It also mentions a new readline backend will be 
available in 3.13 that might help, but that won't be available for a year.

>
> Alex
Alexander Kanavin Aug. 13, 2024, 4:30 p.m. UTC | #3
Thanks. All of this information should be in the patch, can you add
and resend please?

Alex

On Tue, 13 Aug 2024 at 18:27, Trevor Gamblin <tgamblin@baylibre.com> wrote:
>
>
> On 2024-08-13 11:47 a.m., Alexander Kanavin wrote:
> > On Tue, 13 Aug 2024 at 17:30, Trevor Gamblin via
> > lists.openembedded.org <tgamblin=baylibre.com@lists.openembedded.org>
> > wrote:
> >> Python 3.12.5 is failing a newer ptest for reading/writing limited
> >> history. Skip it for now until a proper fix (if any) is determined.
> >> +This test was added recently and is failing on the ptest image. Disable
> >> +it until the proper fix is determined.
> > We should not be disabling tests without any investigation at all into
> > why they fail, just so some other functionality (e.g. version updates)
> > can merge into master. I have to say no to this. Please look into it.
> >
> > If it was added recently, what was the commit that added it? Can you
> > add a link to that commit?
>
> It was added in
> https://github.com/python/cpython/commit/263c7e611bb24715e513d457a3477a61fff15162
>
> The GitHub issue is here: https://github.com/python/cpython/issues/121160
>
> >
> > If it fails, what happens exactly? Where is the failure coming from?
> > Does the test expect something on the target image that isn't being
> > provided?
> >
> > etc.
>
> The failure looks like:
>
> FAIL: test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history)
>
> ======================================================================
> ERROR: test_write_read_limited_history (test.test_readline.TestHistoryManipulation.test_write_read_limited_history)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>    File "/usr/lib/python3.12/test/test_readline.py", line 153, in test_write_read_limited_history
>      readline.read_history_file(TESTFN)
> OSError: [Errno 22] Invalid argument
>
> ======================================================================
> ERROR: test_write_read_limited_history (test.test_readline.TestReadline.test_write_read_limited_history)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>    File "/usr/lib/python3.12/test/test_readline.py", line 362, in test_write_read_limited_history
>      readline.read_history_file(TESTFN)
> OSError: [Errno 22] Invalid argument
>
> ----------------------------------------------------------------------
> Ran 11 tests in 0.266s
>
> FAILED (errors=2, skipped=3)
> test test_readline failed
>
> It's not clear to me what the fix is, seems like maybe an issue with the
> readline available in python3 ptest images. I've looked at TESTFN and
> the HISTORY_FILE environment variable that the test is supposedly using.
> The aforementioned bug report suggests that OSErrors like that show up
> when using the GNU readline-based readline module if a workaround isn't
> also incorporated. It also mentions a new readline backend will be
> available in 3.13 that might help, but that won't be available for a year.
>
> >
> > Alex
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3/0001-test_readline-skip-limited-history-test.patch b/meta/recipes-devtools/python/python3/0001-test_readline-skip-limited-history-test.patch
new file mode 100644
index 0000000000..d8ec33e162
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/0001-test_readline-skip-limited-history-test.patch
@@ -0,0 +1,38 @@ 
+From d9d916d5ea946c945323679d1709de1b87029b96 Mon Sep 17 00:00:00 2001
+From: Trevor Gamblin <tgamblin@baylibre.com>
+Date: Tue, 13 Aug 2024 11:07:05 -0400
+Subject: [PATCH] test_readline: skip limited history test
+
+This test was added recently and is failing on the ptest image. Disable
+it until the proper fix is determined.
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
+---
+ Lib/test/test_readline.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
+index 91fd7dd13f9..d81f9bf8eed 100644
+--- a/Lib/test/test_readline.py
++++ b/Lib/test/test_readline.py
+@@ -132,6 +132,7 @@ def test_nonascii_history(self):
+         self.assertEqual(readline.get_history_item(1), "entrée 1")
+         self.assertEqual(readline.get_history_item(2), "entrée 22")
+ 
++    @unittest.skip("Skipping problematic test")
+     def test_write_read_limited_history(self):
+         previous_length = readline.get_history_length()
+         self.addCleanup(readline.set_history_length, previous_length)
+@@ -349,6 +350,7 @@ def test_history_size(self):
+             self.assertEqual(len(lines), history_size)
+             self.assertEqual(lines[-1].strip(), b"last input")
+ 
++    @unittest.skip("Skipping problematic test")
+     def test_write_read_limited_history(self):
+         previous_length = readline.get_history_length()
+         self.addCleanup(readline.set_history_length, previous_length)
+-- 
+2.39.2
+
diff --git a/meta/recipes-devtools/python/python3_3.12.5.bb b/meta/recipes-devtools/python/python3_3.12.5.bb
index 5665c90fa9..cc2e14baf0 100644
--- a/meta/recipes-devtools/python/python3_3.12.5.bb
+++ b/meta/recipes-devtools/python/python3_3.12.5.bb
@@ -33,6 +33,7 @@  SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
            file://0001-gh-107811-tarfile-treat-overflow-in-UID-GID-as-failu.patch \
 	   file://0001-test_deadlock-skip-problematic-test.patch \
 	   file://0001-test_active_children-skip-problematic-test.patch \
+           file://0001-test_readline-skip-limited-history-test.patch \
            "
 
 SRC_URI:append:class-native = " \