summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-06-19 13:21:46 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-06-19 13:21:46 (GMT)
commit73a582c685d14401f5765c5fdf3ba0437207320e (patch)
tree43eb158cca5e37658bf052292515de09491f2b77
parentec8dfd57db4d9f4cfdef1f38109a55addf6c030a (diff)
parentc2f255fe8425a37da1e023267829f7d497c9a219 (diff)
downloadtcl-73a582c685d14401f5765c5fdf3ba0437207320e.zip
tcl-73a582c685d14401f5765c5fdf3ba0437207320e.tar.gz
tcl-73a582c685d14401f5765c5fdf3ba0437207320e.tar.bz2
Merge 8.6 - fix tests - hardcoded port and wsl.
-rw-r--r--tests/chanio.test11
-rw-r--r--tests/io.test11
2 files changed, 12 insertions, 10 deletions
diff --git a/tests/chanio.test b/tests/chanio.test
index 179d7a7..b80c926 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -7279,22 +7279,23 @@ test chan-io-53.10 {Bug 1350564, multi-directional fcopy} -setup {
}
chan puts stderr SRV
set l {}
- set srv [socket -server new 9999]
+ set srv [socket -server new -myaddr 127.0.0.1 0]
+ set port [lindex [chan configure $srv -sockname] 2]
chan puts stderr WAITING
chan event stdin readable bye
- chan puts OK
+ puts "OK $port"
vwait forever
}
# wait for OK from server.
- chan gets $pipe
+ lassign [chan gets $pipe] ok port
# Now the two clients.
proc done {sock} {
if {[chan eof $sock]} { chan close $sock ; return }
lappend ::forever [chan gets $sock]
return
}
- set a [socket 127.0.0.1 9999]
- set b [socket 127.0.0.1 9999]
+ set a [socket 127.0.0.1 $port]
+ set b [socket 127.0.0.1 $port]
chan configure $a -translation binary -buffering none
chan configure $b -translation binary -buffering none
chan event $a readable [namespace code "done $a"]
diff --git a/tests/io.test b/tests/io.test
index 54ccaac..c0191ee 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -8145,22 +8145,23 @@ test io-53.10 {Bug 1350564, multi-directional fcopy} -setup {
}
puts stderr SRV
set l {}
- set srv [socket -server new 9999]
+ set srv [socket -server new -myaddr 127.0.0.1 0]
+ set port [lindex [fconfigure $srv -sockname] 2]
puts stderr WAITING
fileevent stdin readable bye
- puts OK
+ puts "OK $port"
vwait forever
}
# wait for OK from server.
- gets $pipe
+ lassign [gets $pipe] ok port
# Now the two clients.
proc ::done {sock} {
if {[eof $sock]} { close $sock ; return }
lappend ::forever [gets $sock]
return
}
- set a [socket 127.0.0.1 9999]
- set b [socket 127.0.0.1 9999]
+ set a [socket 127.0.0.1 $port]
+ set b [socket 127.0.0.1 $port]
fconfigure $a -translation binary -buffering none
fconfigure $b -translation binary -buffering none
fileevent $a readable [list ::done $a]