diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2017-08-02 23:38:20 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2017-08-02 23:38:20 (GMT) |
commit | 07fa017898edeacecf2cf454f053948cc7263d0d (patch) | |
tree | 0822f642913e12bc9fec3d1717a1f39a48fa8f03 /tests/http.test | |
parent | 214c9c44a4c822148d4815f89a7657b5354ab9d3 (diff) | |
download | tcl-07fa017898edeacecf2cf454f053948cc7263d0d.zip tcl-07fa017898edeacecf2cf454f053948cc7263d0d.tar.gz tcl-07fa017898edeacecf2cf454f053948cc7263d0d.tar.bz2 |
Fix weird hangs in macOS Sierra on some networks. Name resolution timeouts not what we want to test in the http package.
Diffstat (limited to 'tests/http.test')
-rw-r--r-- | tests/http.test | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/http.test b/tests/http.test index e8f78e3..c2d2fe8 100644 --- a/tests/http.test +++ b/tests/http.test @@ -36,6 +36,13 @@ proc bgerror {args} { puts stderr $errorInfo } +if {$::tcl_platform(os) eq "Darwin"} { + # Name resolution often a problem on OSX; not focus of HTTP package anyway + set HOST localhost +} else { + set HOST [info hostname] +} + set port 8010 set bindata "This is binary data\x0d\x0amore\x0dmore\x0amore\x00null" catch {unset data} @@ -118,8 +125,8 @@ test http-3.1 {http::geturl} -returnCodes error -body { test http-3.2 {http::geturl} -returnCodes error -body { http::geturl http:junk } -result {Unsupported URL: http:junk} -set url //[info hostname]:$port -set badurl //[info hostname]:[expr $port+1] +set url //${::HOST}:$port +set badurl //${::HOST}:[expr $port+1] test http-3.3 {http::geturl} -body { set token [http::geturl $url] http::data $token @@ -130,13 +137,13 @@ test http-3.3 {http::geturl} -body { <h2>GET /</h2> </body></html>" set tail /a/b/c -set url //[info hostname]:$port/a/b/c -set fullurl HTTP://user:pass@[info hostname]:$port/a/b/c -set binurl //[info hostname]:$port/binary -set xmlurl //[info hostname]:$port/xml -set posturl //[info hostname]:$port/post -set badposturl //[info hostname]:$port/droppost -set authorityurl //[info hostname]:$port +set url //${::HOST}:$port/a/b/c +set fullurl HTTP://user:pass@${::HOST}:$port/a/b/c +set binurl //${::HOST}:$port/binary +set xmlurl //${::HOST}:$port/xml +set posturl //${::HOST}:$port/post +set badposturl //${::HOST}:$port/droppost +set authorityurl //${::HOST}:$port set ipv6url http://\[::1\]:$port/ test http-3.4 {http::geturl} -body { set token [http::geturl $url] @@ -149,7 +156,7 @@ test http-3.4 {http::geturl} -body { </body></html>" proc selfproxy {host} { global port - return [list [info hostname] $port] + return [list ${::HOST} $port] } test http-3.5 {http::geturl} -body { http::config -proxyfilter selfproxy @@ -620,7 +627,7 @@ test http-5.5 {http::formatQuery} { } {name1=~bwelch&name2=%A1%A2%A2} test http-6.1 {http::ProxyRequired} -body { - http::config -proxyhost [info hostname] -proxyport $port + http::config -proxyhost ${::HOST} -proxyport $port set token [http::geturl $url] http::wait $token upvar #0 $token data |