Tk Source Code

View Ticket
Login
Ticket UUID: 180c47a672f6fe33c42082812cc5aa53ee082025
Title: Anomalies induced by tests canvPs-3.1 and canvPs-3.2 + one other matter
Type: Bug Version: trunk (at 9.1b0)
Submitter: erikleunissen Created on: 2026-09-18 12:48:57
Subsystem: 06. Canvas Postscript Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2026-09-22 11:05:00
Resolution: None Closed By: nobody
    Closed on:
Description:
Two matters regarding tests canvPs-3.1 and canvPs-3.2:

A. These tests schedule three commands (update; update idletasks; update) for
   execution after 150, 300 and 450 ms respectively. At these times, all tests
   in the test file have already been executed. When running the full Tk test
   suite, these commands are executed many tests later, in tests that are part
   of subsequent test files. This can be seen when adding debug statements like
   this (example for test canvPs-3.1):

--- tests/canvPs.test
+++ tests/canvPs.test
@@ -184,13 +184,13 @@
     wm deiconify .
     raise .
     focus .c.e

     # Extra time for X server
-    after 150 {update}
-    after 300 {update idletasks}
-    after 450 {update}
+    after 150 {puts DBG1; update}
+    after 300 {puts DBG2; update idletasks}
+    after 450 {puts DBG3; update}

     .c postscript -file $bar
     file exists $bar
 } -cleanup {
     destroy .c

When I run the full test suite on my Linux machine, these commands end up
being executed two test files later while test file canvText.test is being
executed (canvPS.test and canvRect.test have already been executed in the
meantime), specifically:

  * DBG1: just before test canvText-1.1
  * DBG2: in between tests canvText-7.1 and canvText-7.2
  * DBG3: in between tests canvText-16.1 and canvText-17.1

    Note: on another machine these commands may be executed at another position
          in the sequence of tests because of a different execution speed.

See also the Tk test suite output in the attached file "test_suite.out".

The scheduled update/update idletasks commands in test canvPs-3.2 are
expected to undergo a similar fate.

These scheduling commands were introduced into the tests by commit [058e738f9f]
to trunk, which merged in branch tk_bidi. On the latter branch, in turn, these
statements were introduced by commit [84214eaca9].

@kevin_walzer: could you please provide information about:
* Was the observed effect intended?
* If so, how is it useful?

B. These same two tests hold an "update idletasks" which immediately succeeds
   "update". It is my understanding that idle tasks are updated as the
   very last thing that a full "update" accomplishes. If that is correct, then
   an explicit "update idletasks" immediately succeeding "update" would be
   useless.

@kevin_walzer: could you please comment on this also?
User Comments: serhiy.storchaka added on 2026-09-22 11:05:00:

Part A bit me: the updates scheduled by canvPs-3.1 and canvPs-3.2 were executed inside the new test canvas-30.1 of [91ba368024] (branch canvas-repick-loop), which then hung, since "update" cannot return while the bindings of that test keep changing the current item. The branch removes the three "after" commands from both tests; a plain update before ".c postscript" is enough for the embedded window to be mapped. If you prefer to fix it differently, the branch can be adjusted.


kevin_walzer added on 2026-09-18 13:51:40:
Looks like "blame" also attributes those other changes to me, but I don't recall those details.

kevin_walzer added on 2026-09-18 13:49:40:
I believe the only changes I made to those tests was to disable one or two that were causing hangs with the test suite when bidi text was enabled.

Attachments: