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

New test_termios fails on Alpinelinux #114492

Closed
andypost opened this issue Jan 23, 2024 · 5 comments
Closed

New test_termios fails on Alpinelinux #114492

andypost opened this issue Jan 23, 2024 · 5 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@andypost
Copy link

andypost commented Jan 23, 2024

Bug report

Bug description:

As reported #81002 (comment) where the test was added

I'm upgrading Python in Alpinelinux to 3.11.7 and testing upgrade to 3.12.1 (both fails the same test)

Re-running test_termios in verbose mode (matching: test_tcgetattr)
test_tcgetattr (test.test_termios.TestFunctions.test_tcgetattr) ... FAIL

======================================================================
FAIL: test_tcgetattr (test.test_termios.TestFunctions.test_tcgetattr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builds/alpine/aports/main/python3/src/Python-3.11.7/Lib/test/test_termios.py", line 42, in test_tcgetattr
    self.assertEqual(termios.tcgetattr(self.stream), attrs)
AssertionError: Lists differ: [1280[227 chars]', b'P', b'\xed', b'\x1a', b'\xf7', b'*', b'z'[18 chars]'(']] != [1280[227 chars]', b'\x01', b'\x00', b'\x00', b'\x00', b' ', b[27 chars]d8']]

First differing element 6:
[b'\x[197 chars]', b'P', b'\xed', b'\x1a', b'\xf7', b'*', b'z'[17 chars]b'(']
[b'\x[197 chars]', b'\x01', b'\x00', b'\x00', b'\x00', b' ', b[26 chars]xd8']

  [1280,
   5,
   191,
   35387,
   15,
   15,
   [b'\x03',
    b'\x1c',
    b'\x7f',
    b'\x15',
    b'\x04',
    b'\x00',
    b'\x01',
    b'\x00',
    b'\x11',
    b'\x13',
    b'\x1a',
    b'\x00',
    b'\x12',
    b'\x0f',
    b'\x17',
    b'\x16',
    b'\x00',
    b'\x00',
    b'\x00',
    b'|',
    b'\xdc',
    b'\xc9',
    b'\xe7',
-   b'P',
-   b'\xed',
-   b'\x1a',
?        -

+   b'\x01',
?       +

+   b'\x00',
+   b'\x00',
+   b'\x00',
+   b' ',
+   b'\xd5',
+   b'$',
    b'\xf7',
+   b'\xd8']]
-   b'*',
-   b'z',
-   b'd',
-   b'\xf7',
-   b'(']]

----------------------------------------------------------------------
Ran 1 test in 0.003s

CPython versions tested on:

3.11, 3.12

Operating systems tested on:

Linux

Linked PRs

@andypost andypost added the type-bug An unexpected behavior, bug, or error label Jan 23, 2024
@andypost
Copy link
Author

Building 3.12.1 I see following log https://gitlab.alpinelinux.org/alpine/aports/-/jobs/1252337

So disabled both meanwhile

Re-running test_tty in verbose mode (matching: test_cfmakeraw, test_setcbreak, test_setraw)
test_cfmakeraw (test.test_tty.TestTty.test_cfmakeraw) ... ok
test_setcbreak (test.test_tty.TestTty.test_setcbreak) ... FAIL
test_setraw (test.test_tty.TestTty.test_setraw) ... FAIL
======================================================================
FAIL: test_setcbreak (test.test_tty.TestTty.test_setcbreak)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builds/alpine/aports/main/python3/src/Python-3.12.1/Lib/test/test_tty.py", line 74, in test_setcbreak
    self.assertEqual(mode1, mode0)
AssertionError: Lists differ: [1280[194 chars]', b'@', b'3', b'\x11', b'o', b'\xe3', b'\x7f'[54 chars]e3']] != [1280[194 chars]', b'\x10', b'W', b'%', b'o', b'\xe3', b'\x7f'[51 chars]e3']]
First differing element 6:
[b'\x[164 chars]', b'@', b'3', b'\x11', b'o', b'\xe3', b'\x7f'[53 chars]xe3']
[b'\x[164 chars]', b'\x10', b'W', b'%', b'o', b'\xe3', b'\x7f'[50 chars]xe3']
  [1280,
   5,
   191,
   35387,
   15,
   15,
   [b'\x03',
    b'\x1c',
    b'\x7f',
    b'\x15',
    b'\x04',
    b'\x00',
    b'\x01',
    b'\x00',
    b'\x11',
    b'\x13',
    b'\x1a',
    b'\x00',
    b'\x12',
    b'\x0f',
    b'\x17',
    b'\x16',
    b'\x00',
    b'\x00',
    b'\x00',
-   b'@',
-   b'3',
-   b'\x11',
?        ^
+   b'\x10',
?        ^
+   b'W',
+   b'%',
    b'o',
    b'\xe3',
    b'\x7f',
    b'\x00',
    b'\x00',
-   b'\x00',
-   b'\x8f',
-   b'%',
?     ^
+   b'v',
?     ^
+   b']',
+   b'\xb6',
    b'o',
    b'\xe3']]
======================================================================
FAIL: test_setraw (test.test_tty.TestTty.test_setraw)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builds/alpine/aports/main/python3/src/Python-3.12.1/Lib/test/test_tty.py", line 63, in test_setraw
    self.assertEqual(mode1, mode0)
AssertionError: Lists differ: [1280[194 chars]', b'@', b'3', b'\x11', b'o', b'\xe3', b'\x7f'[54 chars]e3']] != [1280[194 chars]', b'\x10', b'W', b'%', b'o', b'\xe3', b'\x7f'[51 chars]e3']]
First differing element 6:
[b'\x[164 chars]', b'@', b'3', b'\x11', b'o', b'\xe3', b'\x7f'[53 chars]xe3']
[b'\x[164 chars]', b'\x10', b'W', b'%', b'o', b'\xe3', b'\x7f'[50 chars]xe3']
  [1280,
   5,
   191,
   35387,
   15,
   15,
   [b'\x03',
    b'\x1c',
    b'\x7f',
    b'\x15',
    b'\x04',
    b'\x00',
    b'\x01',
    b'\x00',
    b'\x11',
    b'\x13',
    b'\x1a',
    b'\x00',
    b'\x12',
    b'\x0f',
    b'\x17',
    b'\x16',
    b'\x00',
    b'\x00',
    b'\x00',
-   b'@',
-   b'3',
-   b'\x11',
?        ^
+   b'\x10',
?        ^
+   b'W',
+   b'%',
    b'o',
    b'\xe3',
    b'\x7f',
    b'\x00',
    b'\x00',
-   b'\x00',
-   b'\x8f',
-   b'%',
?     ^
+   b'v',
?     ^
+   b']',
+   b'\xb6',
    b'o',
    b'\xe3']]
----------------------------------------------------------------------
Ran 3 tests in 0.004s
FAILED (failures=2)
test test_tty failed
1 test failed again:
    test_tty

@andypost
Copy link
Author

@Eclips4 Eclips4 added the tests Tests in the Lib/test dir label Jan 23, 2024
@sobolevn
Copy link
Member

cc @serhiy-storchaka

@serhiy-storchaka
Copy link
Member

Please add

self.assertEqual(self.stream.fileno(), self.fd)

Does it fail?

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jan 23, 2024
On Alpine Linux it could leave some field non-initialized.
@serhiy-storchaka
Copy link
Member

If my guess is correct, #114495 may fix this issue. Please test it.

serhiy-storchaka added a commit that referenced this issue Jan 23, 2024
…14495)

On Alpine Linux it could leave some field non-initialized.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 23, 2024
…pythonGH-114495)

On Alpine Linux it could leave some field non-initialized.
(cherry picked from commit d22c066)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 23, 2024
…pythonGH-114495)

On Alpine Linux it could leave some field non-initialized.
(cherry picked from commit d22c066)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue Jan 23, 2024
GH-114495) (GH-114503)

On Alpine Linux it could leave some field non-initialized.
(cherry picked from commit d22c066)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue Jan 23, 2024
GH-114495) (GH-114502)

On Alpine Linux it could leave some field non-initialized.
(cherry picked from commit d22c066)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
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 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants