Title: test_socket.SendfileUsingSendfileTest.testWithTimeoutTriggeredSend fails due to sendfile completing before timeout
Type: Stage:
Components: Tests Versions: Python 3.8, Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bmoyles, giampaolo.rodola, lukasz.langa, tchan
Priority: normal Keywords:

Created on 2017-09-12 22:32 by bmoyles, last changed 2020-05-11 23:04 by tchan.

Messages (2)
msg301998 - (view) Author: Brian Moyles (bmoyles) Date: 2017-09-12 22:32
In building Python 3.6.2 on Ubuntu 16.04, test_socket repeatedly fails at
FAIL: testWithTimeoutTriggeredSend (test.test_socket.SendfileUsingSendfileTest)
Traceback (most recent call last):
  File "/mnt/python/Python-3.6.2/Lib/test/", line 277, in _tearDown
    raise exc
  File "/mnt/python/Python-3.6.2/Lib/test/", line 295, in clientRun
  File "/mnt/python/Python-3.6.2/Lib/test/", line 5358, in _testWithTimeoutTriggeredSend
    self.assertRaises(socket.timeout, meth, file)
AssertionError: timeout not raised by _sendfile_use_sendfile


It appears this is failing as _sendfile_use_sendfile completes before the 0.01s timeout set in _testWithTimeoutTriggeredSend

Adjusting FILESIZE in class SendfileUsingSendTest to 100MB instead of 10MB (or creating FILESIZE on class SendfileUsingSendfileTest so only that set of tests uses a 100MB file) succeeds.

issue17085 was a similar bug from a few years ago but I'm not sure that this can or should be solved in the same way...
msg323878 - (view) Author: Ɓukasz Langa (lukasz.langa) * (Python committer) Date: 2018-08-22 13:26
I'm having the same issue on my devserver at work. I think we need to re-evaluate how those timeouts are working. This is flaky testing.
Date User Action Args
2020-05-11 23:04:40tchansetnosy: + tchan
2018-08-22 13:26:18lukasz.langasetnosy: + giampaolo.rodola
2018-08-22 13:26:06lukasz.langasetnosy: + lukasz.langa

messages: + msg323878
versions: + Python 3.7, Python 3.8
2017-09-12 22:32:43bmoylescreate