async test suite calls are missing cleanup
A number of the async tests that use vwait/after are missing cleanup or have race conditions.
For example, interp-36.7 will fail if the host system is under load as the 'foo' message doesn't get output correctly. Discussion on the #tcl IRC channel led us to incorporating this patch which seems to have made the test more reliable:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/tcltk/tcl/interp.patch
That patch should probably be merged into tcl.
Also, the same problems appear to exists for other tests, for example we just had a failure in socket:
==== socket-14.12 [socket -async] background progress triggered by [fconfigure -error] FAILED
==== Contents of test case:
set s [socket -async localhost [randport]]
for {set i 0} {$i < 50} {incr i} {
set x [fconfigure $s -error]
if {$x != ""} break
after 200
}
set x
---- Result was:
---- Result should have been (exact matching):
connection refused
6b2fff63e6Fix [3b00b2198d]: async test suite calls are missing cleanup check-in2026-10-21 10:58:36ff7935f994Fix [3b00b2198d]: async test suite calls are missing cleanup check-in2026-10-21 10:58:340f5fdaa945Fix [3b00b2198d]: async test suite calls are missing cleanup check-in2026-10-21 10:56:31a81652d24dFix [3b00b2198d]: interp-36.7 waits for the bgerror handler instead of a fixed 10 ms timer, which lost the race on a loaded host. check-in2026-10-20 13:38:25
interp-36.7 has a race: if the process is held up for more than 10 ms, after 0 error foo and after 10 set done fire in the same timer pass and vwait returns before the bgerror handler has run. Reproduced on main and 8.6 by adding a 20 ms sleep before the vwait (result "untouched").
Proposed fix in branch [interp-36.7-race]: wait for the variable the handler sets, with a 10 s timeout. It passes with the added sleep and still fails without child bgerror handler.
socket-14.12 doesn't fail here (randport takes a fresh port from socket -server {} 0 since 2017). A separate ticket with details would help if it still happens.
+1
Test-case only fixes/improvements don't need an entry in the changelog.
Merged into trunk [0f5fdaa945], backported to core-9-0-branch [ff7935f994] and core-8-6-branch [6b2fff63e6].