classification
Title: test_eintr fails randomly on macOS
Type: Stage: resolved
Components: macOS, Tests Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pablogsal Nosy List: miss-islington, ned.deily, pablogsal, ronaldoussoren, vstinner
Priority: normal Keywords: patch

Created on 2018-11-26 14:11 by vstinner, last changed 2018-12-05 23:00 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10782 merged vstinner, 2018-11-29 00:15
PR 10784 merged miss-islington, 2018-11-29 00:35
PR 10785 merged miss-islington, 2018-11-29 00:35
Messages (10)
msg330432 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-26 14:11
test_sleep() of test_eintr fails on VSTS/macOS.

select.select() sleeps 200 ms, the process is supposed to get a signal every 100 ms, but the test says that the signal handler was not called during the test. All tests pass, the issue seems to be specific to macOS.

Maybe select() cannot be interrupted by SIGALRM on macOS?

https://dev.azure.com/Python/cpython/_build/results?buildId=34604&view=logs

2018-11-26T12:51:16.6867210Z FAIL: test_sleep (__main__.TimeEINTRTest)
2018-11-26T12:51:16.6868140Z ----------------------------------------------------------------------
2018-11-26T12:51:16.6868300Z Traceback (most recent call last):
2018-11-26T12:51:16.6868450Z   File "/Users/vsts/agent/2.142.1/work/1/s/Lib/test/eintrdata/eintr_tester.py", line 73, in tearDown
2018-11-26T12:51:16.6868570Z     self.assertGreater(self.signals, 0)
2018-11-26T12:51:16.6869080Z AssertionError: 0 not greater than 0

2018-11-26T12:49:29.9119300Z os.uname: posix.uname_result(sysname='Darwin', nodename='Mac-329.local', release='17.7.0', version='Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64', machine='x86_64')


I added the check (which fails) last week, ensure that the signal handler has been called at least once:

* bpo-35189
* commit aac1f81eef971876ba5b1673db9ce6620311c469
msg330632 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-11-28 22:23
Some buildbots failing with this problem:

https://buildbot.python.org/all/#/builders/145/builds/849
msg330633 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-11-28 22:24
I will investigate with MacOS Mojave this week.
msg330634 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-28 22:49
I'm unable to reproduce the issue using "./python.exe Lib/test/eintrdata/eintr_tester.py -v SelectEINTRTest.test_select" on macOS 10.13.6.
msg330646 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-29 00:34
New changeset 2956bffbc00127af65f69e04d7979021a21d1288 by Victor Stinner in branch 'master':
bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782)
https://github.com/python/cpython/commit/2956bffbc00127af65f69e04d7979021a21d1288
msg330650 - (view) Author: miss-islington (miss-islington) Date: 2018-11-29 00:52
New changeset 2fa5b2ac4485c5c9083b4b0459dd9b691daaea28 by Miss Islington (bot) in branch '3.7':
bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782)
https://github.com/python/cpython/commit/2fa5b2ac4485c5c9083b4b0459dd9b691daaea28
msg330653 - (view) Author: miss-islington (miss-islington) Date: 2018-11-29 00:57
New changeset 833a7067a4d5621d024511d9166db7331c4650c9 by Miss Islington (bot) in branch '3.6':
bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782)
https://github.com/python/cpython/commit/833a7067a4d5621d024511d9166db7331c4650c9
msg330655 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-29 01:16
> I will investigate with MacOS Mojave this week.

Ok, so I leave the issue open.
msg331188 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-05 22:58
I close the issue.

@Pablo: You are free to continue to investigate why sometimes test_sleep() is not interrupted by any signal.
msg331189 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-05 23:00
Note: I just fixed another test_eintr bug on macOS, bpo-35363.
History
Date User Action Args
2018-12-05 23:00:43vstinnersetmessages: + msg331189
2018-12-05 23:00:17vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-12-05 22:58:59vstinnersetmessages: + msg331188
2018-11-29 01:16:26vstinnersetmessages: + msg330655
2018-11-29 00:57:22miss-islingtonsetmessages: + msg330653
2018-11-29 00:52:15miss-islingtonsetnosy: + miss-islington
messages: + msg330650
2018-11-29 00:35:43miss-islingtonsetpull_requests: + pull_request10029
2018-11-29 00:35:25miss-islingtonsetpull_requests: + pull_request10027
2018-11-29 00:34:55vstinnersetmessages: + msg330646
2018-11-29 00:15:29vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request10024
2018-11-28 22:49:45vstinnersetmessages: + msg330634
2018-11-28 22:24:07pablogsalsetassignee: pablogsal
2018-11-28 22:24:03pablogsalsetmessages: + msg330633
2018-11-28 22:23:07pablogsalsetmessages: + msg330632
2018-11-26 14:11:47vstinnercreate