New submission from Pablo Galindo Salgado <pablog...@gmail.com>:

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.

----------
components: Tests, asyncio, macOS
messages: 332637
nosy: asvetlov, ned.deily, pablogsal, ronaldoussoren, yselivanov
priority: normal
severity: normal
status: open
title: Race condition in test_signal_handling_args x86-64 High Sierra 3.75
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35601>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to