Tk Source Code

View Ticket
Login
2022-10-08
21:45 • Ticket [bfea11a9] Aqua: update idletasks handles timer events status still Pending with 4 other changes artifact: aa08a6c1 user: marc_culler
14:34 • Ticket [bfea11a9]: 3 changes artifact: 56eb2bcd user: chrstphrchvz
09:09 • Ticket [bfea11a9]: 3 changes artifact: 7bf33fd2 user: fvogel
00:06 • Ticket [bfea11a9]: 4 changes artifact: ce828780 user: marc_culler
2022-10-06
19:54 • Ticket [bfea11a9]: 3 changes artifact: 715a79de user: fvogel
12:32 • Ticket [bfea11a9]: 4 changes artifact: b01c9fc8 user: marc_culler
06:08 • Ticket [bfea11a9]: 3 changes artifact: 83b07486 user: fvogel
2022-10-05
21:29 • Ticket [bfea11a9]: 4 changes artifact: 7d078e5e user: marc_culler
20:07 • Ticket [bfea11a9]: 3 changes artifact: 7c84cd15 user: fvogel
13:36 • Ticket [bfea11a9]: 4 changes artifact: 446baf00 user: marc_culler
06:09 • Ticket [bfea11a9]: 3 changes artifact: d4c5f767 user: fvogel
01:58 • Ticket [bfea11a9]: 4 changes artifact: ba7c7e93 user: marc_culler
01:35 • Ticket [bfea11a9]: 4 changes artifact: 0ab93998 user: marc_culler
2022-09-25
20:23 • Ticket [bfea11a9]: 3 changes artifact: 4d5b9606 user: marc_culler
19:18
Remove TCL_TIMER_EVENTS and TCL_DONT_WAIT flags introduced in [e0e4d873] (see ticket [bfea11a916] discussing this on 2022-09-25 19:00:10). check-in: 065c110d user: fvogel tags: unstable_tests
19:06 • Ticket [bfea11a9] Aqua: update idletasks handles timer events status still Pending with 3 other changes artifact: ae3920d6 user: fvogel
19:03 • Ticket [bfea11a9]: 3 changes artifact: c31eb2f7 user: fvogel
19:00 • Ticket [bfea11a9]: 3 changes artifact: 66684273 user: fvogel
06:31
Merge 8.6 and fix conflicts triggered by [a48b9196] (Fix [bfea11a916]: update idletasks runs timer events on Aqua). We are on our way out of platform-specific update of widgets, yay! check-in: 64999025 user: fvogel tags: unstable_tests
2022-09-21
16:18 • Pending ticket [bfea11a9]: Aqua: update idletasks handles timer events plus 6 other changes artifact: b0b4bd35 user: marc_culler
15:30
Fix [bfea11a916]: update idletasks runs timer events on Aqua check-in: a48b9196 user: marc_culler tags: core-8-6-branch
05:57 • Ticket [bfea11a9] Aqua: update idletasks handles timer events status still Open with 3 other changes artifact: 669917f1 user: fvogel
04:46 • Ticket [bfea11a9]: 4 changes artifact: 067e3d19 user: marc_culler
2022-09-08
07:16 • Ticket [bfea11a9]: 3 changes artifact: 7506365b user: nab
06:16 • Ticket [bfea11a9]: 3 changes artifact: 1b2ca234 user: fvogel
2022-09-07
23:26 • Ticket [bfea11a9]: 4 changes artifact: ef8e4922 user: marc_culler
05:53 • Ticket [bfea11a9]: 3 changes artifact: 5d199253 user: fvogel
2022-09-06
23:20 • Ticket [bfea11a9]: 3 changes artifact: 49e470fc user: chrstphrchvz
16:05 • Ticket [bfea11a9]: 4 changes artifact: a889c42e user: marc_culler
15:57
Fix [bfea11a916]: make XSync a no-op on Aqua (again). closed check-in: da12b404 user: marc_culler tags: bug-bfea11a916
04:17 • Ticket [bfea11a9] Aqua: update idletasks handles timer events status still Open with 4 other changes artifact: 310812d0 user: marc_culler
00:14 • Ticket [bfea11a9]: 4 changes artifact: 1e69c7a2 user: marc_culler
2022-09-05
20:00 • Ticket [bfea11a9]: 3 changes artifact: a98093fc user: chrstphrchvz
2022-08-25
22:06 • Ticket [bfea11a9]: 4 changes artifact: 06966b55 user: marc_culler
06:09 • Ticket [bfea11a9]: 3 changes artifact: 0f603af9 user: fvogel
2022-08-24
21:55 • Ticket [bfea11a9]: 4 changes artifact: 4a8d7e40 user: marc_culler
21:39 • Ticket [bfea11a9]: 4 changes artifact: 35d92d31 user: marc_culler
06:22 • Ticket [bfea11a9]: 3 changes artifact: f17c2f06 user: fvogel
2022-08-23
21:20 • Ticket [3e9e82bc] Aqua: draw to alternative backing store status still Open with 3 other changes artifact: 988a224a user: chrstphrchvz
20:27 • New ticket [bfea11a9] Aqua: update idletasks handles timer events. artifact: 2f4332a2 user: chrstphrchvz

Ticket UUID: bfea11a916042e986a29f0223fc24128e9c5392c
Title: Aqua: update idletasks handles timer events
Type: Bug Version: 8.6.11 and later
Submitter: chrstphrchvz Created on: 2022-08-23 20:27:43
Subsystem: 70. Event Loop Assigned To: marc_culler
Priority: 5 Medium Severity: Minor
Status: Pending Last Modified: 2022-10-08 21:45:07
Resolution: Fixed Closed By: nobody
    Closed on:
Description:

What is the expected output of the following script on each platform?

set t0 [clock milliseconds]
after 1000 {puts Timer}
puts Waiting
while {$t0 + 2000 > [clock milliseconds]} {
    update idletasks
}
puts Done
update

Currently, on Aqua (only after Tk is loaded), the output is Waiting ⏎ Timer ⏎ Done; but for X11, and for Tcl without Tk loaded, it is Waiting ⏎ Done ⏎ Timer. Based on the documentation of update idletasks, I’m inclined to believe the latter is the expected behavior.

The different behavior on Aqua is due to timer events being handled in its XSync() implementation, added in [af841408b2fb] and discussed briefly in [7ebdd17974] (see Marc’s comment dated 2020-07-16 03:28:12). I likely do not understand why this change was needed for update on Aqua to behave more like update on other platforms, but I believe it was likely an oversight for it to affect the behavior of update idletasks.

User Comments: marc_culler (claiming to be Marc Culler) added on 2022-10-08 21:45:07:
While working on the new test failures with Ventura I discovered that
there is some indeterminacy in when Tk_MakeWindowExist gets called.
For example, the raise_setup proc in raise.test contains this loop:
    foreach i {a b c d e} {
            label .raise.$i -text $i -relief raised -bd 2
       }
You might expect Tk_MakeWindowExist to be called for a b c d e in that
order.  But the actual order when you run the tests in raise.test seems
to be e d c b a a e d c b c e d b a e d c ...
and that order can change, for example if delays are added or removed.

chrstphrchvz added on 2022-10-08 14:34:55:

At this point I believe the mac-specific code has a missing call to Tk_MakeWindowExist() or some similar call, but I fail to say where.

That sounds possibly related to [f16cdb6d04]/[a64a4b331e].


fvogel added on 2022-10-08 09:09:26:

I seems to me that the only rational explanation of the behavior of the test suite is that we have race conditions in the tests that should be fixed. Unstable test results only happen on the mac platform. I'm striving to achieve stable test results in branch unstable_tests, with some success (especially with font-*.test tests, but by far not only those tests).

If you think the timer vevent processing in EmbedGeometryRequest() should be kept in place, so be it. It does not harm regarding the tests (same non repeatable failure with or without this processing, I have confirmed this already).

A common pattern of many remaining non-repeatable failures is that "winfo id ..." or "winfo geometry ..." returns an error because the window it asks for does not (yet) exist, despite it was created just before in the test. The errorCode is TK LOOKUP WINDOW, meaning the window is not found in the hash table. I'm struggling with this for quite some time in branch unstable_tests, I have tried several things, see [775b8e0389], [72d070de7e], [930cc27b01], [645a3198d9], [a8787ce7ff], [ef554a855f], [ed391aad14], [8a3687e83c], finally reverting all of them [351f749505]. My tries include what you have tried in [7deafa6f20], which won't work (rerun all jobs manually at the CI runner e.g. 20 times, and you should observe this).

At this point I believe the mac-specific code has a missing call to Tk_MakeWindowExist() or some similar call, but I fail to say where.


marc_culler (claiming to be Marc Culler) added on 2022-10-08 00:06:52:
I think the answer is that we should leave the timer event processing in place.

The main reason is that Nicolas Bats reported a crash of his app when he made
that change in the mac_styles_87 branch.  But it has several other unpleasant
consequences, none of which I am able to explain.  These include the CI failure
of unixEmbed-11.2 (which only runs on the mac).  But also with the
no_embed_timer branch I see sporadic failures of other tests on my "real"
hardware, such as font-47.2 and font-47.3, which I have never seen before
and cannot reproduce with core-8-6-branch.

Now this story gets weirder when you look at the code.  The loop which processes
timer events is in EmbedGeometryRequest.  That is a static function which is
only called by ContainerEventProc, the event handler for SubstructureNotify
events. According to the comments written by DKF for ContainerEventProc:
 *      NOTE: on the Mac, only the DestroyNotify branch is ever taken. We
 *      don't synthesize the other events.
So the loop that we are talking about only runs when an embedded toplevel
is destroyed.

That means it cannot affect any behavior of embedded windows which could be
tested manually.  It also means that the loop never gets run when the font
tests are being run.  I verified this by putting an abort() command at the
beginning of CoontainerEventProc.  Running the tests in font.test produced
no abort.  So, somehow, modifying a loop which is never run affects the
behavior of the font tests?  That seems pretty unlikely.  But there it is.

And there is another even weirder wrinkle.  The only situation in which I
was able to get font-47.2 and font-47.3 to fail is this: I had to unplug
my second monitor.  (This causes both screens to go blank for a few seconds
while the system reconfigures the graphics card.) Then if I run the font
tests I would see those tests fail on the first and sometimes second run
of the font tests.  After that they never failed and also they never failed
with core-8-6-branch.  Also, the failure for the first run after unplugging
the monitor was fairly consistent (but not completely consistent).

So, explain that, please.

fvogel added on 2022-10-06 19:54:36:
Indeed. Put my wording on the count of my non-native english. Sorry.

marc_culler (claiming to be Marc Culler) added on 2022-10-06 12:32:33:
I think it is strange to call it a "plain update" when in fact update is
much more complex than update idletasks, and can involve the equivalent of
running update idletasks arbitrarily many times.

fvogel added on 2022-10-06 06:08:49:

When I asked for the testing result with the no_embed_timer branch, I had manual testing in mind. Is rendering of embedded windows OK or do we need to keepo the flags in the event processing loop in EmbedGeometryRequest()?

Regarding unixEmbed-11.2, font-47.2, font-47.3, textImage-4.2 I'm fighting against these for quite some time in branch unstable_tests.

font-47.2, font-47.3, textImage-4.2 always fail together: either none of them fail, or they all fail. I couldn't reproduce this and had no clue so far they were linked to any dual monitor setup. They all create some initial situation, then change a font setting, and look at the result. When running at CI, they fail or pass apparently randomly in successive runs. If you managed to be sure that the failures are due to this monitor setup, that would be a good thing to know. But are you really sure? Are the failures totally reproducible with a given monitor setup, do they disappear reliably with another setup, and do they reliably reappear when returning to the initial setup? In branch unstable_tests, I tried a different approach to stabilize these. This is apparently working, except I get a hang in 1 run in 10 tries (not acceptable, I have to refine this). If the real cause is the monitor setup then it would be a big thing to know. I have no idea what monitor configuration the CI runner uses, but I would find surprising if it would change from one run to another one, triggering pass or fail for these tests.

The other remaining sporadic failures are in tests that create toplevels with -container 1 and next call winfo id. That is, what you have seen failing in unixEmbed-11.2. In that category there is also unixEmbed-10.1 and unixEmbed-10.2. There was also frame-3.10. I made an experiment [7126436832] on that one since I didn't understand why there should be a platform difference in how we wait for the window to come up. The result was that frame-3.10 failed 7 times in 10 runs at GitHub. I have then reverted this, see [3e0e3306ad], and the test didn't fail again. I don't understand why update idletasks is needed on the mac, and why a plain update does not do the job, but this may be a lead for the other failures with signature ---- errorInfo: bad window path name while executing "winfo id .main.f"


marc_culler (claiming to be Marc Culler) added on 2022-10-05 21:29:22:
Well, the CI runner reported one failure:

---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: bad window path name ".main.f"
    while executing
"winfo id .main.f"
    ("uplevel" body line 8)
    invoked from within
"uplevel 1 $script"
---- errorCode: TK LOOKUP WINDOW .main.f
==== unixEmbed-11.2 FAILED

I think that is probably fixable by waiting for .main.f to exist before trying
to use it.  Perhaps handling the timer events was adding a small delay which made
this test pass.

At home, on real hardware, I got some failures, but not that one.  They seemed
to be related to having a second monitor.  When I had the second monitor turned
on I got failures in font-47.2 and font-47.3 as well as in textImage-4.2
and wm-maxsize-1.7.  The wm-maxsize-1.7 is clearly related to the second monitor
since it affects the screen size.  But the font measurement could also be affected
because the monitors have different pixel sizes.  Also, by the way, windows
sometimes open on the second screen during tests.

Turning the second monitor off made the font-47.2 and font-47.3 tests pass.
But there was still a problem with textImage-4.2.  Unplugging the second monitor
made all tests pass.

I wonder what the monitor configuration is on the CI runner.  Do you have any
idea?

fvogel added on 2022-10-05 20:07:31:
Well, I'm fine with us saying the remaining  while(Tcl_DoOneEvent(whatever_flags)  are OK. Let's keep those occurrences then.

What's the testing result for the no_embed_timer branch?

marc_culler (claiming to be Marc Culler) added on 2022-10-05 13:36:14:
There is no possibility of making the Aqua port use those loops in the
same way as the unix and Windows ports.

The heart of the drawRect method is a loop of the type you are describing.
We certainly need that, and there is nothing comparable in X11 or Windows.
In drawRect an expose event is generated for every widget which meets the
dirty rectangle.  Those expose events all have the same serial number and
they are immediately processed using a filter to ensure that only the
expose events from one run of drawRect get processed.  When an expose event
is sent to a widget, the widget posts its display proc as an idle task.
So processing all of the expose events causes many idle tasks to get
posted.  Drawing is only allowed in drawRect (for applications which use
drawRect).  So those idle tasks must all be processed before drawRect
exits.  Otherwise no actual drawing will take place and all windows will
be black.  So we absolutely have to run
   while(Tcl_DoOneEvent(TCL_IDLE_EVENTS)){}
in contexts where unix and Windows do not.

In general, though, it should be fine to process idle tasks at any time.
There are no guarantees about when an idle task gets run.  So no code should
make any assumptions about when an idle task will run, other than that it
will eventually get run at some time in the future.

fvogel added on 2022-10-05 06:09:31:

Great! I also have tried your change [bdc0639e] in EmbedGeometryRequest (see [065c110d], branch unstable_tests). I have found the test suite to pass identically without the TCL_TIMER_EVENTS and TCL_DONT_WAIT flags there. But I didn't check the visual effects (are the embedded windows correctly rendered?). Since Removing these flags did not help stabilizing the test suite (which is my goal in that unstable_tests branch), I have put them back in [3c2dd0f1], letting this flag chasing happen elsewhere, which is now your new branch no_embed_timer.

Apart from the two occurrences you mentioned, the mac code has several other places where idle events are processed. Grep for "while (Tcl_DoOneEvent" (with the space after the while). True enough, these places do not use the TCL_TIMER_EVENTS and TCL_DONT_WAIT flags. On the unix side there is only one such place, and on Windows two such places. Maybe that's right, but since you are there could you perhaps confirm these procecessings of idle events are right on the mac?


marc_culler (claiming to be Marc Culler) added on 2022-10-05 01:58:16:
I found two places in the core-8-6-branch macoss directory where there
were loops like:
  while(Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)){}
One such plase in the backgroundLoop thread.  I think it is necessary to
process timer events in that loop.  There are situations where the Apple
window manager processes all events without passing them on to Tk.  The
main one is when a menu is open.  If timer events are not processed in the
backgroundLoop you can see the effect by, for example, starting the
pendulum demo and then opening a menu.  If timer events are not processed
the pendulum animation stops as soon as a menu is opened and starts moving
as soon as the menu is closed.  If timer events are processed then the
pendulum keeps swinging while the menu is open.

So I am not going to change the backgroundLoop.  The other place where I
found timer events being processed is in EmbedGeometryRequest.  I am going
to remove the timer event processing there and see if I can detect any
side effects.

marc_culler (claiming to be Marc Culler) added on 2022-10-05 01:35:13:
I am going to create a branch from core-8-6-branch which never processes
any timer events in any of the mini-event loops in the Aqua port.

I don't remember the details very well but I think the timer event
processing was added as a desperate attempt to get the verious text
widget tests to pass.  I also think they are not needed now and are
probably causing trouble.  So let's see what happens if we take them
out.

marc_culler added on 2022-09-25 20:23:35:
Hi Francois, I can't do all of the research while driving through Wyoming
but I think you should look at ticket 278fdd11d9.

That said, things have changed since then. Getting rid of those loops
may be the right thing to do now. They were always hacks.

fvogel added on 2022-09-25 19:06:35:

Note that all the changes from [e0e4d873] were later reverted, except the one in macosx/tkMacOSXEmbed.c. Is this TCL_DONT_WAIT flag really necessary at this place?


fvogel added on 2022-09-25 19:03:20:

Clickable link to the suspicious commit: [e0e4d873] (sorry!)


fvogel added on 2022-09-25 19:00:10:
Thanks Marc.

I'm suspecting commit [e0e4d873] to be unnecessary or even wrong, could you please explain why you did this? I believe this commit prevents reliable results in some of the unixEmbed-1?.* tests at Github (in my unstable_tests branch). Constraints were added to prevent these tests from running at CI, but I believe this is hiding the dust under the carpet. The issue is not the CI but those event processing loops having TCL_DONT_WAIT set. What do you think?

marc_culler (claiming to be Marc Culler) added on 2022-09-21 16:18:25:
Leaving this as pending after the merge so we can look at the other
mini event loops.

fvogel added on 2022-09-21 05:57:31:

I'd say yes (on the grounds of other people test results, since I didn't test), but what I'm wondering is about the other instances of the same pattern, e.g. quoting myself (sorry!):

    Regarding processing of events in loops like:

        while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)) {}

    this pattern can still be found in the macOS specific code in
    EmbedGeometryRequest(), _runBackgroundLoop, generateExposeEvents
    and several other places. Most of them only process TCL_IDLE_EVENTS,
    but in the light of the discussion here I'm starting to think some
    of those look suspicious.

Are we sure those other instances of that pattern really must exist, and that everything is correct at those places?

True enough, whether the answer to this question is yes or no does not change the fact one could merge the current state since at least one place got fixed.


marc_culler (claiming to be Marc Culler) added on 2022-09-21 04:46:54:
Can this be merged?

nab added on 2022-09-08 07:16:57:
Hi,
in my customTK (trunk+mac_styles_87), in XSync() I've removed the call to 
while (Tcl_DoOneEvent(TCL_TIMER_EVENTS|TCL_DONT_WAIT)){}

and I do not notice any visual glitches in my app (please note that I do not use update though... only update idletasks)

++

fvogel added on 2022-09-08 06:16:17:

Running (manually) Github Actions a second time does not reproduce the failure, therefore the change in XSync() is not the culprit. Failure of entry-5.7 must be one of the many unstable tests I'm chasing and stabilizing in the unstable_tests branch.

Regarding processing of events in loops like:

    while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)) {}

this pattern can still be found in the macOS specific code in EmbedGeometryRequest(), _runBackgroundLoop, generateExposeEvents and several other places. Most of them only process TCL_IDLE_EVENTS, but in the light of the discussion here I'm starting to think some of those look suspicious.


marc_culler (claiming to be Marc Culler) added on 2022-09-07 23:26:28:
Hi François, the CI runner logged a failure on entry-5.7.  A font measurement
was wrong.  The error only happened in the Development version.  I am tempted
to say that the error is not related to the changes in the bug-bfea11a916
branch. But that test does involve a call to vwait and a call to update
idletasks.  What do you think?

(Needless to say, I cannot reproduce the error on my computer.)

fvogel added on 2022-09-07 05:53:45:

Marc, Christopher, let me just say what is happening here is of HUGE interest to me for my work toward stabilization of the test suite results on macOS. Many thanks for all your work, I'm following closely!


chrstphrchvz added on 2022-09-06 23:20:35:

Still catching up, however Marc’s branch matches what I tried in https://github.com/chrstphrchvz/tk/commit/255867cf6cde and https://github.com/chrstphrchvz/tk/commit/1380d13a8254.


marc_culler (claiming to be Marc Culler) added on 2022-09-06 16:05:15:
I have created a bugfix branch for this.  It does what Christopher was
implicitly suggesting, namely to remove the event loop from XSync.  This
creates test failures in textDisp.test and textWind.test.  But those
failures can be avoided by making Aqua call update, rather than update
idletasks, as is done for the other platforms.

With these changes the code snippet in the ticket produces the same result
on Aqua as on the other platforms and all tests pass on my computer.  Let's
see if the CI runner agrees that all tests still pass.

Presumably we should make the code snippet into a non-regression test.
Where should it go?

marc_culler (claiming to be Marc Culler) added on 2022-09-06 04:17:10:
This is what I learned:

1. Applying Eric's Tcl patch from [0221b993a1] had no effect.

2. I don't understand [da5f2266df].  I see that it contains a long, testy
comment from me, for which I apologize, but that comment seems to have
nothing to do with the ticket.  I think I may have submitted it to the
wrong ticket by mistake.  But I could not find a ticket proposing changes
to Tk_Update for which my nasty comment might have at least been on topic.
Anyway, no patch is proposed in [da5f2266df].

3. I screwed up my previous experiment.  I simply removed the
TCL_TIMER_EVENTS flag, leaving only the TCL_DONT_WAIT flag which is
equivalent to using the TCL_ALL_EVENTS flag.  That was stupid.  What I
should have done was to remove the while loop containing the call to
Tcl_DoOneEvent, making XSync a no-op.  When I did that I found that the
test failures in main.test, frame.test and unixEmbed.test disappeared.
But there were errors in textDisp.test: 31.3, 31.6, 31,7, 33.2, 10.4,
10.8 and 11.1 (Development only).

(I think this means that the main reason for processing timer events in
XSync was to make the textDisp tests pass.)

The failing tests involve the asynchronous updates that the Text widget
uses.  There are platform-specific procedures named delay and textUpdate
in the textDisp.test file that are used by the failing tests.  The
difference is that for Aqua these procedures call update idletasks, while
the other platforms call update. I found that the failures go away if I
make the aqua version be the same as the other one, so it calls update
(and also remove the event loop from XSync).

marc_culler (claiming to be Marc Culler) added on 2022-09-06 00:14:44:
That seems like an interesting idea. Let's make the change in Tcl that Eric
suggested and see what happens.

chrstphrchvz added on 2022-09-05 20:00:50:

This could be bumping into issues like [da5f2266df] or 0221b993a1 (which is won’t-fix for 8.6).


marc_culler (claiming to be Marc Culler) added on 2022-08-25 22:06:27:
I got identical results on a second run.  But the fact that different
tests fail for the Development and Deployment branches suggests that
there are race conditions involved.

fvogel added on 2022-08-25 06:09:52:
Are those failures stable from one run to another one?

marc_culler (claiming to be Marc Culler) added on 2022-08-24 21:55:21:
When I remove the TCL_TIMER_EVENTS flag I see these failures:
main-2.1
main-2.2
frame-3.10 (Development only)
unixEmbed-10.1 (Deployment only)

marc_culler (claiming to be Marc Culler) added on 2022-08-24 21:39:58:
There are many tests in the test suite which fail unless calls to update
are made during the test.  For quite some time there were tests which
would fail on Aqua but would pass if the call to update was replaced by
a call to update idletasks, although doing that would make the test fail
on other platforms.  I believe that adding timer tasks to XSync was an
attempt to make some of those tests pass without having to have platform
specific code in the test which would choose between update and update idletasks.

Things have changed since then.  I would say that if we can remove the
TCL_TIMER_EVENTS flag and not create any new test failures then we should
do that.  If removing the flag does create new test failures then we
will have to think about why.

fvogel added on 2022-08-24 06:22:24:
On Windows, the output is Waiting ⏎ Done ⏎ Timer

But if you package require Tk first before running the script, the output is Waiting ⏎ Timer ⏎ Done