Thread: [tclwebtest] do_link -nocomplain doesn't behave as documented
Status: Abandoned
Brought to you by:
tils
From: Grzegorz A. H. <gr...@ef...> - 2003-01-24 11:27:45
|
Hi. Trying the following script: foreach url {http://www.efaber.net/fallo http://www.efaber.net/} { do_request -nocomplain $url } I get such a log: ----- START: in_memory string at [24/Jan/2003:12:20:39] ----- --- do_request for http://www.efaber.net/fallo http status: >>500<< do_request did not return a page. HTTP status is 500 in script body line 3 ----- FAILED: in_memory string (took 1s) ----- Looks like do_request notices the use of -nocomplain, but the test unit is interrupted. Is this expected? The log is exactly the same without -nocomplain. I didn't know what to change in do_request to make the test unit go forward ignoring the error. It also fails if the domain name doesn't exist, but with a socket traceback. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Tilmann S. <ti...@ti...> - 2003-01-24 14:30:14
|
Hi, * Grzegorz Adam Hankiewicz <gr...@ef...> [20030124 11:28]: > Trying the following script: > > foreach url {http://www.efaber.net/fallo http://www.efaber.net/} { > do_request -nocomplain $url > } This might be an error introduced with the ad_proc rewrite (damn, we need better self tests). Try to replace $nocomplain with $nocomplain_p within the do_request proc and tell me if that works. I would try it out myself but I just started working on the cookie stuff and then ran out of time so my local copy is not in a working state right now ... til -- http://tsinger.com |
From: Grzegorz A. H. <gr...@ef...> - 2003-01-27 15:05:53
|
On Fri, Jan 24, 2003 at 02:29:04PM +0000, Tilmann Singer wrote: > This might be an error introduced with the ad_proc rewrite (damn, we > need better self tests). Try to replace $nocomplain with $nocomplain_p > within the do_request proc and tell me if that works. It works. I generated this patch against my own CVS because the one at SF still doesn't have my previous one. The function still fails if you try to connect to a non-existant server. Index: tclwebtest.tcl =================================================================== RCS file: /home/maincvs/efintranet/www/tclwebtest/prog/tclwebtest.tcl,v retrieving revision 1.4 diff -u -r1.4 tclwebtest.tcl --- tclwebtest.tcl 22 Jan 2003 18:11:54 -0000 1.4 +++ tclwebtest.tcl 27 Jan 2003 14:58:28 -0000 @@ -1672,7 +1672,7 @@ } { link_variables regexp_defs - if $nocomplain { + if $nocomplain_p { set nocomplain_option "-nocomplain" } else { set nocomplain_option "" @@ -1782,9 +1782,11 @@ eval "do_request $nocomplain_option $followequiv_option $location" } elseif { $http_status != "200" } { - debug -lib "$nocomplain" - if { !$nocomplain } { + debug -lib "$nocomplain_p" + if { !$nocomplain_p } { assertion_failed "do_request did not return a page. HTTP status is $http_status" + } else { + log "Bad http answer ignored due to -nocomplain" } } -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-01-31 09:09:57
Attachments:
silencing_socket_error.gz
|
> The function still fails if you try to connect to a non-existant > server. The attached patch fixes that, but it's ugly, leaves the global variables in an undefined state, and there seem to be more places where such errors should be catched, but that requires a bigger rewrite or redesign of the function. Unwilling to get a big patch rejected, I'll let you to decide what to do with socket errors. Well, the truth is I still don't understand all the code of do_request, so I could introduce even more bugs (that tcl upvar stuff is still a mistery for me, no matter how many times I reread the manual). -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-01-31 09:21:29
|
On Fri, Jan 31, 2003 at 10:07:00AM +0100, Grzegorz Adam Hankiewicz wrote: > > The function still fails if you try to connect to a non-existant > > server. > > The attached patch fixes that. Forgot to say how the output of a log looks like: ----- START: in_memory string at [31/Jan/2003:10:16:14] ----- --- do_request for http://do.not.exist/ ignoring very bad http result: >>couldn't open socket: host is unreachable<< --- do_request for http://do.not.exist/ do_request did not return a page: 'couldn't open socket: host is unreachable'. HTTP status is 555 in script body line 2 ... SOURCE CODE ... log [do_request -nocomplain http://do.not.exist/] log [do_request http://do.not.exist/] ^^^^^ ERROR ^^^^^ ----- FAILED: in_memory string (took 1s) ----- -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-10 09:12:29
|
On Fri, Jan 24, 2003 at 02:29:04PM +0000, Tilmann Singer wrote: > Try to replace $nocomplain with $nocomplain_p within the do_request > proc and tell me if that works. Commited. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |