summaryrefslogtreecommitdiffstats
path: root/tests/io.test
diff options
context:
space:
mode:
authorkennykb <kennykb@noemail.net>2004-07-02 18:36:55 (GMT)
committerkennykb <kennykb@noemail.net>2004-07-02 18:36:55 (GMT)
commit51bbfa844498a1e72b6bdad8b4d2409b1e01c278 (patch)
treed14decb1e66ee37b3fd26ce569222c4893c6d5b8 /tests/io.test
parent92ce57111dfbe54a485d2be320f82ef6f3d262eb (diff)
downloadtcl-51bbfa844498a1e72b6bdad8b4d2409b1e01c278.zip
tcl-51bbfa844498a1e72b6bdad8b4d2409b1e01c278.tar.gz
tcl-51bbfa844498a1e72b6bdad8b4d2409b1e01c278.tar.bz2
tests/io.test: Changed several tests to run the event
loop rather than just calling [update] periodically, avoiding intermittent failures (usually in io-29.32) that stemmed from unreaped processes on Windows. FossilOrigin-Name: 74c189e67a197f1f90e3546aa0ac7ebd69bd40ea
Diffstat (limited to 'tests/io.test')
-rw-r--r--tests/io.test27
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/io.test b/tests/io.test
index e7eda1f..d9e9b60 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: io.test,v 1.57 2004/06/23 22:02:41 patthoyts Exp $
+# RCS: @(#) $Id: io.test,v 1.58 2004/07/02 18:36:56 kennykb Exp $
if {[catch {package require tcltest 2}]} {
puts stderr "Skipping tests in [info script]. tcltest 2 required."
@@ -2049,9 +2049,8 @@ test io-27.6 {FlushChannel, async flushing, async close} \
close $f
set counter 0
while {([file size $path(output)] < 65536) && ($counter < 1000)} {
- incr counter
- after 20
- update
+ after 20 [list incr [namespace which -variable counter]]
+ vwait [namespace which -variable counter]
}
if {$counter == 1000} {
set result "file size only [file size $path(output)]"
@@ -2126,9 +2125,8 @@ test io-28.3 {CloseChannel, not called before output queue is empty} \
close $f
set counter 0
while {([file size $path(output)] < 20480) && ($counter < 1000)} {
- incr counter
- after 20
- update
+ after 20 [list incr [namespace which -variable counter]]
+ vwait [namespace which -variable counter]
}
if {$counter == 1000} {
set result probably_broken
@@ -2611,15 +2609,19 @@ test io-29.31 {Tcl_WriteChars, background flush} {stdio openpipe} {
close $f
set counter 0
while {([file size $path(output)] < 65536) && ($counter < 1000)} {
- incr counter
- after 5
- update
+ after 10 [list incr [namespace which -variable counter]]
+ vwait [namespace which -variable counter]
}
if {$counter == 1000} {
set result "file size only [file size $path(output)]"
} else {
set result ok
}
+ # allow a little time for the background process to close.
+ # otherwise, the following test fails on the [file delete $path(output)
+ # on Windows because a process still has the file open.
+ after 100 set v 1; vwait v
+ set result
} ok
test io-29.32 {Tcl_WriteChars, background flush to slow reader} \
{stdio asyncPipeClose openpipe} {
@@ -2649,9 +2651,8 @@ test io-29.32 {Tcl_WriteChars, background flush to slow reader} \
close $f
set counter 0
while {([file size $path(output)] < 65536) && ($counter < 1000)} {
- incr counter
- after 20
- update
+ after 20 [list incr [namespace which -variable counter]]
+ vwait [namespace which -variable counter]
}
if {$counter == 1000} {
set result "file size only [file size $path(output)]"