pipe: time-related sporadic hangs in io/chan-io tests
after 20 will be replaced with after 1).
As one can see build # 567003451 is passed, and after some small changes the heisenbug is reproduced in all build jobs build # 567076288.
The shorter the sleep intervals, the better it is reproducible.
Here is the code to reproduce it in shell:
proc ::tcltest::cleanupTestsHook {} {
if {$::tcltest::numTests(Failed)} {error failed}
}
timerate {source tests/io.test} 10000
package require tcltest
namespace import -force ::tcltest::*
tcltest::configure -match io-29.32
9b3b167cb5Fix the async pipe close tests, see [e484a8407c]. io-27.6, io-29.32, chan-io-27.6 and chan-io-29.32 returned before the child process closed the output file, so deleting it in the next test failed on Windows ("permission denied"); wait for a marker file the child creates after closing it. The chan-io tests never ran: their asyncPipeClose constraint was mangled into "asyncPipeChan Close" when chanio.test was created. check-in2026-10-14 10:21:14ed0826597bNew ticket [7cf7cce423] windows: `socket -async localhost $port` can hang sporadically in gethostbyname. ticket2020-08-10 15:38:12b7866f6f90Ticket [1adeb65446] chan-io-29.34 hangs on Windows status still Closed with 5 other changes ticket2019-09-05 10:03:25d46f4fb95bTicket [1adeb65446] chan-io-29.34 hangs on Windows status still Closed with 5 other changes ticket2019-09-04 22:24:16
I'm seeing a repeatable hang for (unmodified) chanio-29.34 on Windows, see [1adeb65446].
Those test-case are marked knownMsvcBug now. That doesn't mean it's solved, but at least Travis builds don't fail any more for those test-cases, if they are the only ones failing: It should not block a release, since it's likely a long-time problem not a regression.
just as an interim info: this is not reproducible at all with RFE [fdfbd5e10] (together with fix for [815e246806], but I think it is not really affected here), seems to be fixed in RFE using ChannelScheduledEvent (previously timer-event) with new prolongation handling (retarding).
Nope, reproduced the hang also (with RFE [fdfbd5e10]) testing that in VM...
Just needed some more time (1h), possibly because the event-handling is several times faster there, so 1ms is "too" long (quasi same as not reduced "after 20" in original tcl-core).
Found it, branch core-8-5-branch-fix-1997007 with few small changes fixed it for win & mingw, so after fix (without RFE) got applied, I see no hangs anymore approximately within 1 hour testing (where it hung in at the latest in 10 seconds previously), so I'll rebase it to fossil and provide the fix soon.
The hangs do not reproduce on Windows 11 with 9.1 and 8.6, even with after 1 in the child scripts (over 1400 runs of io-27.6, io-29.32, chan-io-27.6 and chan-io-29.32).
With the shortened sleep the tests failed sporadically for another reason: they returned before the child closed the output file, so file delete $path(output) in the next test failed with "permission denied". The chan-io tests never ran at all: their constraint asyncPipeClose was mangled into "asyncPipeChan Close" when chanio.test was created.
Proposed fix in branch tests-async-pipe-close: the tests wait for a marker file the child creates after closing the output file, and the chan-io constraint is fixed. 1200 runs on Windows without failures.