classification
Title: Race condition in test_signal_handling_args x86-64 High Sierra 3.75
Type: behavior Stage: resolved
Components: asyncio, macOS, Tests Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, miss-islington, ned.deily, pablogsal, ronaldoussoren, yselivanov
Priority: normal Keywords: patch, patch, patch

Created on 2018-12-28 03:45 by pablogsal, last changed 2019-01-18 01:00 by ned.deily. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11337 merged pablogsal, 2018-12-28 03:52
PR 11337 merged pablogsal, 2018-12-28 03:52
PR 11337 merged pablogsal, 2018-12-28 03:52
PR 11348 merged miss-islington, 2018-12-29 01:40
PR 11348 merged miss-islington, 2018-12-29 01:40
PR 11348 merged miss-islington, 2018-12-29 01:40
PR 11349 merged miss-islington, 2018-12-29 01:41
PR 11349 merged miss-islington, 2018-12-29 01:41
PR 11349 merged miss-islington, 2018-12-29 01:41
Messages (5)
msg332637 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-12-28 03:45
There is a race condition in FAIL: test_signal_handling_args (test.test_asyncio.test_events.KqueueEventLoopTests) in macOS:

https://buildbot.python.org/all/#/builders/147/builds/546/steps/4/logs/stdio

======================================================================
FAIL: test_signal_handling_args (test.test_asyncio.test_events.KqueueEventLoopTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_asyncio/test_events.py", line 595, in test_signal_handling_args
    self.assertEqual(caught, 1)
AssertionError: 0 != 1

It seems that SIGALRM is never received in the 0.5 seconds of timeout:

    def test_signal_handling_args(self):
        some_args = (42,)
        caught = 0

        def my_handler(*args):
            nonlocal caught
            caught += 1
            self.assertEqual(args, some_args)

        self.loop.add_signal_handler(signal.SIGALRM, my_handler, *some_args)

        signal.setitimer(signal.ITIMER_REAL, 0.1, 0)  # Send SIGALRM once.
        self.loop.call_later(0.5, self.loop.stop)
        self.loop.run_forever()
        self.assertEqual(caught, 1)

Maybe we should set up a much bigger timeout and make the handle stop the event loop.
msg332688 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-12-29 01:40
New changeset 5471420faa84519530f29b08f2b042b2288e3e96 by Pablo Galindo in branch 'master':
bpo-35601: Alleviate race condition when waiting for SIGALRM in test_asyncio (GH-11337)
https://github.com/python/cpython/commit/5471420faa84519530f29b08f2b042b2288e3e96
msg332689 - (view) Author: miss-islington (miss-islington) Date: 2018-12-29 02:01
New changeset 8f9228dd3a37c98876c9c8ff7fb0042650303474 by Miss Islington (bot) in branch '3.7':
bpo-35601: Alleviate race condition when waiting for SIGALRM in test_asyncio (GH-11337)
https://github.com/python/cpython/commit/8f9228dd3a37c98876c9c8ff7fb0042650303474
msg332730 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-12-29 19:36
I am going to close this one as the only branch left is 3.6 and is on security fixes only.
msg333921 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2019-01-18 01:00
New changeset 7eef540ab89e426b622373f43713521876447f2f by Ned Deily (Miss Islington (bot)) in branch '3.6':
bpo-35601: Alleviate race condition when waiting for SIGALRM in test_asyncio (GH-11337) (GH-11348)
https://github.com/python/cpython/commit/7eef540ab89e426b622373f43713521876447f2f
History
Date User Action Args
2019-01-18 01:00:50ned.deilysetmessages: + msg333921
2018-12-29 19:36:51pablogsalsetstatus: open -> closed
messages: + msg332730

keywords: patch, patch, patch
resolution: fixed
stage: patch review -> resolved
2018-12-29 02:01:02miss-islingtonsetnosy: + miss-islington
messages: + msg332689
2018-12-29 01:41:32miss-islingtonsetpull_requests: + pull_request10648
2018-12-29 01:41:21miss-islingtonsetpull_requests: + pull_request10649
2018-12-29 01:41:13miss-islingtonsetpull_requests: + pull_request10650
2018-12-29 01:41:06miss-islingtonsetpull_requests: + pull_request10647
2018-12-29 01:40:59miss-islingtonsetpull_requests: + pull_request10646
2018-12-29 01:40:52miss-islingtonsetpull_requests: + pull_request10645
2018-12-29 01:40:25pablogsalsetmessages: + msg332688
2018-12-28 03:52:46pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request10614
2018-12-28 03:52:35pablogsalsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10613
2018-12-28 03:52:24pablogsalsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10612
2018-12-28 03:45:59pablogsalcreate