Title: test_pty: test_basic() fails randomly on Travis CI
Type: Stage:
Components: Tests Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Cornelius Diekmann, cstratak, haypo, martin.panter, xdegaye
Priority: normal Keywords:

Created on 2017-08-09 10:52 by haypo, last changed 2017-08-13 20:41 by xdegaye.

Pull Requests
URL Status Linked Edit
PR 3037 closed haypo, 2017-08-09 11:01
Messages (5)
msg299987 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-08-09 10:52

0:13:26 load avg: 134.81 [256/403] test_pty
test test_pty failed -- Traceback (most recent call last):
  File "/home/travis/build/python/cpython/Lib/test/", line 109, in test_basic
    self.assertEqual(b'For my pet fish, Eric.\n', normalize_output(s2))
AssertionError: b'For my pet fish, Eric.\n' != b'For m'
msg299988 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2017-08-09 11:02
I don't know why test_pty fails. makes sure that all data is written into the master fd using a new write_all() helper function which loops until all data is written: handle os.write() partial write.
msg299991 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-08-09 11:55
Checking for short writes is worthwhile, but in Issue 29070 it looks like Cornelius identified the main problem was short _reads_. See the parts of his patch to do with “_os_read_exactly” and related functions.
msg299995 - (view) Author: Charalampos Stratakis (cstratak) * Date: 2017-08-09 12:24
I've observed the exact same issue on Fedora at random times.
msg300067 - (view) Author: Cornelius Diekmann (Cornelius Diekmann) * Date: 2017-08-10 09:28
I observed the same issue, but the problem occurs mainly when reading data. In my proposed patch in issue29070, I use the existing pty._writen() to make sure all data is written. As Martin mentioned, reading is a problem. My patch proposes _os_timeout_read(), _os_readline(), _os_read_exactly(), _os_read_exhaust_exactly() to give fine-grained, deterministic control. Cheeky advertisement: Anybody cares to review issue29070 or cherry pick the pty._writen() and _os_read* parts? :)
Date User Action Args
2017-08-13 20:41:20xdegayesetnosy: + xdegaye
2017-08-10 09:28:59Cornelius Diekmannsetmessages: + msg300067
2017-08-09 12:24:31cstrataksetnosy: + cstratak
messages: + msg299995
2017-08-09 11:55:50martin.pantersetnosy: + Cornelius Diekmann, martin.panter
messages: + msg299991
2017-08-09 11:02:16hayposetmessages: + msg299988
2017-08-09 11:01:18hayposetpull_requests: + pull_request3070
2017-08-09 10:52:13haypocreate