Skip to content

test_wm_iconbitmap() timeout after 10 min on "macOS / build and test (macos-26-intel)" CI #146531

Description

@vstinner

Example of failure: https://github.com/python/cpython/actions/runs/23552862012/job/68571481619?pr=146357

(...)
test_wm_attribute (test.test_tkinter.test_misc.WmTest.test_wm_attribute) ... ok
test_wm_iconbitmap (test.test_tkinter.test_misc.WmTest.test_wm_iconbitmap) ... Timeout (0:10:00)!
Thread 0x00007ff85c48cc00 (most recent call first):
  File "/Users/runner/work/cpython/cpython/Lib/tkinter/__init__.py", line 2345 in wm_iconbitmap
  File "/Users/runner/work/cpython/cpython/Lib/test/test_tkinter/test_misc.py", line 582 in test_wm_iconbitmap
  File "/Users/runner/work/cpython/cpython/Lib/unittest/case.py", line 613 in _callTestMethod
  File "/Users/runner/work/cpython/cpython/Lib/unittest/case.py", line 667 in run
(...)

test.pythoninfo:

tkinter.TCL_VERSION: 9.0
tkinter.TK_VERSION: 9.0
tkinter.info_patchlevel: 9.0.3

The test_wm_iconbitmap() test was added by commit 58e9f95.

Linked PRs

Activity

  1. vstinner commented on Mar 27, 2026

    @vstinner
    MemberAuthor

    "Lib/tkinter/__init__.py, line 2345 in wm_iconbitmap" is the last line of wm_iconbitmap(), where I added the comment:

        def wm_iconbitmap(self, bitmap=None, default=None):
            """Set bitmap for the iconified widget to BITMAP. Return
            the bitmap if None is given.
    
            Under Windows, the DEFAULT parameter can be used to set the icon
            for the widget and any descendants that don't have an icon set
            explicitly.  DEFAULT can be the relative path to a .ico file
            (example: root.iconbitmap(default='myicon.ico') ).  See Tk
            documentation for more information."""
            if default is not None:
                return self.tk.call('wm', 'iconbitmap', self._w, '-default', default)
            else:
                return self.tk.call('wm', 'iconbitmap', self._w, bitmap) # <=== HANGS HERE
  2. serhiy-storchaka commented on Mar 28, 2026

    @serhiy-storchaka
    Member

    It seems that it hangs on the first call with argument. I don't have macOS, so I cannot test in what circumstances it hangs. Can this be reproduced manually?

    $ wish
    % toplevel .t
    .t
    % wm iconbitmap .t
    % wm iconbitmap .t hourglass
    % 

    Is is a bug in Tk 9.0.3 or in all Tk 9.0 versions and we just started to run tests with 9.0?

  3. vstinner commented on Apr 1, 2026

    @vstinner
    MemberAuthor

    I don't have macOS, so I cannot test.

    Is is a bug in Tk 9.0.3 or in all Tk 9.0 versions and we just started to run tests with 9.0?

    Good question. I didn't check if Tk was upgraded recently on the macOS-intel image.

  4. hugovk commented on Apr 2, 2026

    @hugovk
    Member

    I suspect this is due to switching from the macos-15-intel runner to macos-26-intel on 25th March: #145099.

    We started getting timeouts on 26th March: https://github.com/python/cpython/actions/runs/23591302016/job/68696963892

    Actually, the very first run after the merge had a timeout on first attempt, and pass on the next: https://github.com/python/cpython/actions/runs/23538226684/job/68518834548#step:10:2115

    Looks like a bug in Tk 9.0.3 on macOS 26 Intel, but macOS 26 Apple Silicon and macOS 15 (Intel + Apple Silicon) are all fine.

    Here's a test of running wish with 'wm iconbitmap . hourglass\nputs "OK: wm iconbitmap succeeded"\nexit\n' on all four. macOS 26 Intel times out after 60s, the others pass in a second or less:

    This needs reporting to Tk.

    Some things we could do in the meantime:

    Is is a bug in Tk 9.0.3 or in all Tk 9.0 versions and we just started to run tests with 9.0?

    Unknown if it's only in 9.0.3. We've been testing 9.0.3 since November, and macOS 26 only since March.

  5. hugovk commented on Apr 2, 2026

    @hugovk
    Member

    Is is a bug in Tk 9.0.3 or in all Tk 9.0 versions and we just started to run tests with 9.0?

    Also times out with version 8, specifically 8.6.17:

    https://github.com/hugovk/test/actions/runs/23889733245

  6. hugovk commented on Apr 2, 2026

    @hugovk
    Member
  7. hugovk commented on Apr 3, 2026

    @hugovk
    Member

    I opened #148032 to skip the Tk test on macOS 26 Intel, but the CI hung when configuring CPython:

    We've seen some other similar things too: #145098 (comment)

    So I've also opened #148038 to switch back to macos-15-intel for the main tests.

  8. vstinner commented on Apr 7, 2026

    @vstinner
    MemberAuthor

    The GitHub Action jobs moved back to macos-15-intel which should work around this issue. So I close this issue for now. Reopen it if the issues reappears on our CIs.

  9. hugovk commented on May 18, 2026

    @hugovk
    Member

    Re-opening to fix the timeout now we're ready to upgrade the CI: #149991.

  10. reopened this on May 18, 2026
  11. 1 remaining item

  12. ned-deily commented on May 18, 2026

    @ned-deily
    Member

    I don't recall seeing this particular timeout when running tests on real Macs, either Apple Silicon or Intel. It could be due to the GHA setup. I don't have access to an Intel Mac at the moment but I can test it next week after PyCon.

  13. vstinner commented on May 18, 2026

    @vstinner
    MemberAuthor

    Can we close the issue since PR gh-148032 has been merged?

  14. ned-deily commented on May 18, 2026

    @ned-deily
    Member

    Can we close the issue since PR gh-148032 has been merged?

    I would prefer to keep it open until we know better why this timeout occurs. We shouldn't have to disable the test.

  15. hugovk commented on Jul 6, 2026

    @hugovk
    Member

    I've backported #149991 from main back to 3.12 and we ran into some timeouts:

    Backport PRs of #149991

    Branch PR macOS job tkinter
    3.15 #153179 (merged) green, 18m Timeout (10 min) first pass; rerun passed
    3.14 #153181 (merged) green, 18m Passed, no timeout
    3.13 #153185 (open) red, 25m SIGSEGV first pass; Timeout (10 min) on rerun
    3.12 #153186 (merged) green, 14m Passed, no timeout

    Post-merge branch runs

    Branch macOS job tkinter
    3.15 green, 28m Timeout (10 min) first pass; rerun passed
    3.14 red, 27m SIGSEGV first pass; Timeout (10 min) on rerun
    3.13 — Not merged yet
    3.12 green, 17m Passed, no timeout

    So I'll also backport the test skip, until we get a fix.

  16. added 4 commits that reference this issue on Jul 6, 2026
  17. serhiy-storchaka commented on Jul 6, 2026

    @serhiy-storchaka
    Member

    Try to backport PRs for #69134. The parts which touch existing tests, because many new tests were added.

  18. hugovk commented on Jul 8, 2026

    @hugovk
    Member

    We just got a timeout on for this test macos-26-intel at https://github.com/python/cpython/actions/runs/28940873616/job/85862500892?pr=153327 with Tk 8.6.18.

    When 8.6.17 and 9.0.3 were the latest versions, we added this skip:

            if (
                t._windowingsystem == 'aqua'
                and sys.platform == 'darwin'
                and platform.machine() == 'x86_64'
                and platform.mac_ver()[0].startswith('26.')
                and (
                    patchlevel[:3] <= (8, 6, 17)
                    or (9, 0) <= patchlevel[:3] <= (9, 0, 3)
                )
            ):
                # https://github.com/python/cpython/issues/146531
                # Tk bug 4a2070f0d3a99aa412bc582d386d575ca2f37323
                self.skipTest('wm iconbitmap hangs on macOS 26 Intel')

    Since then, 8.6.18 and 9.0.4 have come out, and 8.6.18 has filtered through Homebrew to our tests. We're still on 9.0.3 on main.

    I suggest we skip for all versions until there's a fix available:

            if (
                t._windowingsystem == 'aqua'
                and sys.platform == 'darwin'
                and platform.machine() == 'x86_64'
                and platform.mac_ver()[0].startswith('26.')
            ):
                # https://github.com/python/cpython/issues/146531
                # Tk bug 4a2070f0d3a99aa412bc582d386d575ca2f37323
                # Not fixed as of Tk 8.6.18 and 9.0.4.
                self.skipTest('wm iconbitmap hangs on macOS 26 Intel')

    Try to backport PRs for #69134. The parts which touch existing tests, because many new tests were added.

    Those three PRs have all been backported to 3.13. We test Tk 9 on main/3.15, and still have Tk 8 on 3.14 and older.

    Here's a run on 3.14, modified to do 4 x macos-26-intel, so it has 8.6.18 that evades the skip, and we can see if those PRs help:

    And we got four timeouts:

    • Result: FAILURE then SUCCESS
    • Result: FAILURE then FAILURE
    • Result: FAILURE then SUCCESS
    • Result: SUCCESS

    So they don't help in this case.

  19. added 5 commits that reference this issue on Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions