Tk Source Code

View Ticket
Login
Ticket UUID: e4a05184e951b447b1f7343b07a4a2a166877b85
Title: unixEmbed-11.2 is failing sometimes on CI (macOS)
Type: Bug Version:
Submitter: fvogel Created on: 2021-12-04 20:53:26
Subsystem: 86. Test Tools Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2022-06-12 10:47:53
Resolution: Fixed Closed By: fvogel
    Closed on: 2022-06-12 10:47:53
Description:

unixEmbed-11.2 is still failing sometimes on CI for macOS, but running the job again makes it pass. Conclusion: there is a race condition of some kind.

Examples of failure:

With core-8-6-branch: https://github.com/tcltk/tk/runs/4309150124?check_suite_focus=true

With the macos_enter_leave branch: https://github.com/tcltk/tk/runs/4296386504?check_suite_focus=true

With some bugfix branch dealing with another ticket: https://github.com/tcltk/tk/runs/4405408272?check_suite_focus=true

As far as I can see when it fails it is always with clang and --enable-symbols=mem --enable-aqua.

Marc has posted an analysis of a possible cause for this in [18682cb277].

User Comments: fvogel added on 2022-06-12 10:47:53:

The test was seen failing once more at GitHub. More complete fix applied, see [775b8e03].


fvogel added on 2022-04-24 08:46:17:

Fix seems to work, more than 10 runs of the tests at GitHub didn't allow to reproduce the failure.

The fix will be merged when the unstable_tests branch will get merged.


fvogel added on 2022-04-23 19:33:45:

[501b0a7b] seems to fix this.

Currently running the tests many times at GitHub Actions for confirmation.


fvogel added on 2022-04-10 20:17:52:

When the test fails one gets:

==== unixEmbed-11.2 mouse coordinates in embedded toplevels FAILED
==== Contents of test case:

    toplevel .main
    set result {}
    pack [button .main.b -text "Main Button"  -command {lappend result ".main.b"}] -padx 30 -pady 30
    pack [frame .main.f -container 1 -width 200 -height 200] -fill both
    update idletasks
    toplevel .embed -use [winfo id .main.f] -bg green
    pack [button .embed.b -text "Emb Button"  -command {lappend result ".embed.b"}] -padx 30 -pady 30
    wm geometry .main 200x400+100+100
    update idletasks
    focus -force .main
    after 100
    set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}]
    set y [expr {[winfo y .main ] + [winfo y .main.b] + 38}]
    lappend result [winfo containing $x $y]
    after 200
    pressbutton $x $y
    update
    set y [expr {$y + 80}]
    lappend result [winfo containing $x $y]
    after 200
    pressbutton $x $y
    update
    set result

---- Result was:
.main.b .main.b .main
---- Result should have been (exact matching):
.main.b .main.b .embed.b .embed.b
==== unixEmbed-11.2 FAILED

This seems to indicate that the second call to [winfo containing $x $y] returns "main" and the -command script from .embed.b does not trigger. This should mean that the embedded window .embed is not yet mapped (race condition).