summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-02-26 13:37:42 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-02-26 13:37:42 (GMT)
commit3c1b36a619e7fcc1e4029bdcb55e5fdb32692748 (patch)
tree85503726ba20fec2a95e9534548a4015187c4d15 /tests
parent67d13bd63cda0688634601703ab45d349c9d68bf (diff)
downloadtcl-3c1b36a619e7fcc1e4029bdcb55e5fdb32692748.zip
tcl-3c1b36a619e7fcc1e4029bdcb55e5fdb32692748.tar.gz
tcl-3c1b36a619e7fcc1e4029bdcb55e5fdb32692748.tar.bz2
[Bug 3605120]: Stop test chan-io-28.7 from hanging when run standalone.
Diffstat (limited to 'tests')
-rw-r--r--tests/chanio.test14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/chanio.test b/tests/chanio.test
index 665df50..999d0bb 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -2214,13 +2214,17 @@ test chan-io-28.7 {Tcl_CloseEx (half-close) socket} -setup {
puts $sok DONE
exit 0
} echo.tcl]
-} -body {
+ variable done
+ unset -nocomplain done
+ set done ""
+ set timer ""
set ff [openpipe r $echo]
gets $ff port
+} -body {
set s [socket 127.0.0.1 $port]
puts $s Hey
close $s w
- set timer [after 1000 [namespace code {set ::done Failed}]]
+ set timer [after 1000 [namespace code {set done Failed}]]
set acc {}
fileevent $s readable [namespace code {
if {[gets $s line]<0} {
@@ -2230,11 +2234,11 @@ test chan-io-28.7 {Tcl_CloseEx (half-close) socket} -setup {
}
}]
vwait [namespace which -variable done]
- after cancel $timer
- close $s r
- close $ff
list $done $acc
} -cleanup {
+ catch {close $s}
+ close $ff
+ after cancel $timer
removeFile echo.tcl
} -result {Succeeded {Hey DONE}}