summaryrefslogtreecommitdiffstats
path: root/tests/zlib.test
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-03-06 20:02:55 (GMT)
committersebres <sebres@users.sourceforge.net>2017-03-06 20:02:55 (GMT)
commit089381e2b134caf0f0f090d827403469a45691b4 (patch)
tree107e10d265aa3e222ef112384c10189ed19de788 /tests/zlib.test
parent94253c0df4577e70f66326d590cba9330ba8421e (diff)
downloadtcl-089381e2b134caf0f0f090d827403469a45691b4.zip
tcl-089381e2b134caf0f0f090d827403469a45691b4.tar.gz
tcl-089381e2b134caf0f0f090d827403469a45691b4.tar.bz2
zlib.test: fix sporadic errors:
- zlib-9.2 hangs because of too short update, if processed another event; - zlib-8.8 wrong non-blocking pipe usage - [string length $compressed] may return sporadically values smaller as expected (< 222)
Diffstat (limited to 'tests/zlib.test')
-rw-r--r--tests/zlib.test8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/zlib.test b/tests/zlib.test
index 1e69745..63bac7e 100644
--- a/tests/zlib.test
+++ b/tests/zlib.test
@@ -311,7 +311,7 @@ test zlib-8.8 {transformation and fconfigure} -setup {
lassign [chan pipe] inSide outSide
} -constraints zlib -body {
zlib push compress $outSide -dictionary $spdyDict
- fconfigure $outSide -blocking 0 -translation binary -buffering none
+ fconfigure $outSide -blocking 1 -translation binary -buffering none
fconfigure $inSide -blocking 1 -translation binary
puts -nonewline $outSide $spdyHeaders
chan pop $outSide
@@ -508,6 +508,7 @@ test zlib-9.2 "socket fcopy with push" -constraints zlib -setup {
chan configure $c -translation binary -buffering none -blocking 0
puts -nonewline $c [zlib gzip [string repeat a 81920]]
close $c
+ set ::total -1
}}} 0]
set file [makeFile {} test.gz]
} -body {
@@ -515,7 +516,10 @@ test zlib-9.2 "socket fcopy with push" -constraints zlib -setup {
set sin [socket $addr $port]
chan configure $sin -translation binary
zlib push gunzip $sin
- update
+ after 1000 {set ::total timeout}
+ vwait ::total
+ after cancel {set ::total timeout}
+ if {$::total != -1} {error "unexpected value $::total of ::total"}
set total [fcopy $sin [set fout [open $file wb]]]
close $sin
close $fout