Skip to content

bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() #28449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 22, 2021

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 18, 2021

It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up.

https://bugs.python.org/issue45238

It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up.
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Sep 18, 2021
Comment on lines +170 to +172
def __del__(self):
if self._asyncioTestLoop is not None:
self._tearDownAsyncioLoop()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks a little weird but I don't have better idea.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks very weird. And you should ensure that the IsolatedAsyncioTestCase instance is destroyed before any other event loop is run, otherwise you can get an ugly message on the stderr during garbage collecting.

@ambv ambv added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 20, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ambv for commit 5eb175c 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 20, 2021
@ambv ambv added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 21, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ambv for commit daf807f 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 21, 2021
@ambv ambv merged commit ecb6922 into python:main Sep 22, 2021
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @serhiy-storchaka and @ambv, I had trouble checking out the 3.10 backport branch.
Please backport using cherry_picker on command line.
cherry_picker ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d 3.10

@miss-islington
Copy link
Contributor

Sorry, @serhiy-storchaka and @ambv, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d 3.9

@ambv ambv added needs backport to 3.10 only security fixes and removed needs backport to 3.10 only security fixes labels Sep 22, 2021
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @serhiy-storchaka and @ambv, I had trouble checking out the 3.10 backport branch.
Please backport using cherry_picker on command line.
cherry_picker ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d 3.10

@ambv
Copy link
Contributor

ambv commented Sep 22, 2021

whyyy

ambv pushed a commit to ambv/cpython that referenced this pull request Sep 22, 2021
…nGH-28449)

It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up.
(cherry picked from commit ecb6922)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

GH-28521 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Sep 22, 2021
ambv pushed a commit to ambv/cpython that referenced this pull request Sep 22, 2021
…GH-28449)

It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up..
(cherry picked from commit ecb6922)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Sep 22, 2021
@bedevere-bot
Copy link

GH-28522 is a backport of this pull request to the 3.9 branch.

ambv added a commit that referenced this pull request Sep 22, 2021
) (GH-28521)

It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up.
(cherry picked from commit ecb6922)

Co-authored-by: Serhiy Storchaka <[email protected]>
ambv added a commit that referenced this pull request Sep 22, 2021
…) (GH-28522)

It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up..
(cherry picked from commit ecb6922)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Arch Linux Asan 3.x has failed when building commit ecb6922.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/582/builds/568) and take a look at the build logs.
  4. Check if the failure is related to this commit (ecb6922) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/582/builds/568

Summary of the results of the build (if available):

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
    cache[rtype].remove(name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '/psm_47f6fecd'


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
    cache[rtype].remove(name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '/psm_0ba819e7'

@bedevere-bot
Copy link

bedevere-bot commented Sep 22, 2021

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Arch Linux Asan Debug 3.x has failed when building commit ecb6922.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/585/builds/572) and take a look at the build logs.
  4. Check if the failure is related to this commit (ecb6922) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/585/builds/572

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 68, done.        
remote: Counting objects:   1% (1/62)        
remote: Counting objects:   3% (2/62)        
remote: Counting objects:   4% (3/62)        
remote: Counting objects:   6% (4/62)        
remote: Counting objects:   8% (5/62)        
remote: Counting objects:   9% (6/62)        
remote: Counting objects:  11% (7/62)        
remote: Counting objects:  12% (8/62)        
remote: Counting objects:  14% (9/62)        
remote: Counting objects:  16% (10/62)        
remote: Counting objects:  17% (11/62)        
remote: Counting objects:  19% (12/62)        
remote: Counting objects:  20% (13/62)        
remote: Counting objects:  22% (14/62)        
remote: Counting objects:  24% (15/62)        
remote: Counting objects:  25% (16/62)        
remote: Counting objects:  27% (17/62)        
remote: Counting objects:  29% (18/62)        
remote: Counting objects:  30% (19/62)        
remote: Counting objects:  32% (20/62)        
remote: Counting objects:  33% (21/62)        
remote: Counting objects:  35% (22/62)        
remote: Counting objects:  37% (23/62)        
remote: Counting objects:  38% (24/62)        
remote: Counting objects:  40% (25/62)        
remote: Counting objects:  41% (26/62)        
remote: Counting objects:  43% (27/62)        
remote: Counting objects:  45% (28/62)        
remote: Counting objects:  46% (29/62)        
remote: Counting objects:  48% (30/62)        
remote: Counting objects:  50% (31/62)        
remote: Counting objects:  51% (32/62)        
remote: Counting objects:  53% (33/62)        
remote: Counting objects:  54% (34/62)        
remote: Counting objects:  56% (35/62)        
remote: Counting objects:  58% (36/62)        
remote: Counting objects:  59% (37/62)        
remote: Counting objects:  61% (38/62)        
remote: Counting objects:  62% (39/62)        
remote: Counting objects:  64% (40/62)        
remote: Counting objects:  66% (41/62)        
remote: Counting objects:  67% (42/62)        
remote: Counting objects:  69% (43/62)        
remote: Counting objects:  70% (44/62)        
remote: Counting objects:  72% (45/62)        
remote: Counting objects:  74% (46/62)        
remote: Counting objects:  75% (47/62)        
remote: Counting objects:  77% (48/62)        
remote: Counting objects:  79% (49/62)        
remote: Counting objects:  80% (50/62)        
remote: Counting objects:  82% (51/62)        
remote: Counting objects:  83% (52/62)        
remote: Counting objects:  85% (53/62)        
remote: Counting objects:  87% (54/62)        
remote: Counting objects:  88% (55/62)        
remote: Counting objects:  90% (56/62)        
remote: Counting objects:  91% (57/62)        
remote: Counting objects:  93% (58/62)        
remote: Counting objects:  95% (59/62)        
remote: Counting objects:  96% (60/62)        
remote: Counting objects:  98% (61/62)        
remote: Counting objects: 100% (62/62)        
remote: Counting objects: 100% (62/62), done.        
remote: Compressing objects:   4% (1/22)        
remote: Compressing objects:   9% (2/22)        
remote: Compressing objects:  13% (3/22)        
remote: Compressing objects:  18% (4/22)        
remote: Compressing objects:  22% (5/22)        
remote: Compressing objects:  27% (6/22)        
remote: Compressing objects:  31% (7/22)        
remote: Compressing objects:  36% (8/22)        
remote: Compressing objects:  40% (9/22)        
remote: Compressing objects:  45% (10/22)        
remote: Compressing objects:  50% (11/22)        
remote: Compressing objects:  54% (12/22)        
remote: Compressing objects:  59% (13/22)        
remote: Compressing objects:  63% (14/22)        
remote: Compressing objects:  68% (15/22)        
remote: Compressing objects:  72% (16/22)        
remote: Compressing objects:  77% (17/22)        
remote: Compressing objects:  81% (18/22)        
remote: Compressing objects:  86% (19/22)        
remote: Compressing objects:  90% (20/22)        
remote: Compressing objects:  95% (21/22)        
remote: Compressing objects: 100% (22/22)        
remote: Compressing objects: 100% (22/22), done.        
remote: Total 68 (delta 41), reused 48 (delta 40), pack-reused 6        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to 'ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at ecb6922ff2 [bpo-45238](https://bugs.python.org/issue45238): Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449)
Switched to and reset branch 'main'

./configure: line 10581: PKG_PROG_PKG_CONFIG: command not found

In file included from /buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan_debug/build/Modules/expat/expat_config.h:8,
                 from /buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan_debug/build/Modules/expat/xmltok.c:53:
./pyconfig.h:1634: warning: "_POSIX_C_SOURCE" redefined
 1634 | #define _POSIX_C_SOURCE 200809L
      | 
In file included from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/string.h:26,
                 from /buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan_debug/build/Modules/expat/xmltok.c:46:
/usr/include/features.h:310: note: this is the location of the previous definition
  310 | # define _POSIX_C_SOURCE 199506L
      | 
renaming build/scripts-3.11/pydoc3 to build/scripts-3.11/pydoc3.11
renaming build/scripts-3.11/idle3 to build/scripts-3.11/idle3.11
renaming build/scripts-3.11/2to3 to build/scripts-3.11/2to3-3.11

renaming build/scripts-3.11/pydoc3 to build/scripts-3.11/pydoc3.11
renaming build/scripts-3.11/idle3 to build/scripts-3.11/idle3.11
renaming build/scripts-3.11/2to3 to build/scripts-3.11/2to3-3.11

renaming build/scripts-3.11/pydoc3 to build/scripts-3.11/pydoc3.11
renaming build/scripts-3.11/idle3 to build/scripts-3.11/idle3.11
renaming build/scripts-3.11/2to3 to build/scripts-3.11/2to3-3.11
test_kqueue skipped -- test works only on BSD
test_ioctl skipped -- Unable to open /dev/tty
test_startfile skipped -- object <module 'os' from '/buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan_debug/build/Lib/os.py'> has no attribute 'startfile'
test_badargs (__main__.GeneralTest) ... ok
test_bound_methods (__main__.GeneralTest) ... ok
test_clear (__main__.GeneralTest) ... ok
test_exit (__main__.GeneralTest) ... ok
test_order (__main__.GeneralTest) ... ok
test_raise (__main__.GeneralTest) ... ok
test_raise_unnormalized (__main__.GeneralTest) ... ok
test_stress (__main__.GeneralTest) ... ok
test_unregister (__main__.GeneralTest) ... ok

----------------------------------------------------------------------
Ran 9 tests in 0.002s

OK
test_flock (__main__.FNTLEINTRTest) ... ok
test_lockf (__main__.FNTLEINTRTest) ... ok
test_read (__main__.OSEINTRTest) ... ok
test_wait (__main__.OSEINTRTest) ... ok
test_wait3 (__main__.OSEINTRTest) ... ok
test_wait4 (__main__.OSEINTRTest) ... ok
test_waitpid (__main__.OSEINTRTest) ... ok
test_write (__main__.OSEINTRTest) ... ok
test_devpoll (__main__.SelectEINTRTest) ... skipped 'need select.devpoll'
test_epoll (__main__.SelectEINTRTest) ... ok
test_kqueue (__main__.SelectEINTRTest) ... skipped 'need select.kqueue'
test_poll (__main__.SelectEINTRTest) ... ok
test_select (__main__.SelectEINTRTest) ... ok
test_sigtimedwait (__main__.SignalEINTRTest) ... ok
test_sigwaitinfo (__main__.SignalEINTRTest) ... ok
test_accept (__main__.SocketEINTRTest) ... ok
test_open (__main__.SocketEINTRTest) ... ok
test_os_open (__main__.SocketEINTRTest) ... ok
test_recv (__main__.SocketEINTRTest) ... ok
test_recvmsg (__main__.SocketEINTRTest) ... ok
test_send (__main__.SocketEINTRTest) ... ok
test_sendall (__main__.SocketEINTRTest) ... ok
test_sendmsg (__main__.SocketEINTRTest) ... ok
test_sleep (__main__.TimeEINTRTest) ... ok

----------------------------------------------------------------------
Ran 24 tests in 7.427s

OK (skipped=2)
test_tk skipped -- Tk unavailable due to TclError: couldn't connect to display ":99"
test_winconsoleio skipped -- test only relevant on win32
test_winsound skipped -- No module named 'winsound'
test_winreg skipped -- No module named 'winreg'
test_tix skipped -- Tk unavailable due to TclError: couldn't connect to display ":99"
test_ttk_guionly skipped -- Tk unavailable due to TclError: couldn't connect to display ":99"
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
test_msilib skipped -- No module named '_msi'
test_devpoll skipped -- test works only on Solaris OS family
<string>:2: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
make: *** [Makefile:1307: buildbottest] Terminated

Cannot open file '/buildbot/buildarea/3.x.pablogsal-arch-x86_64.asan_debug/build/test-results.xml' for upload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants