[naviserver-devel] Test failures: while executing "close $wfd" invoked from within "nstest_http ..."
From: Stephen D. <sd...@gm...> - 2006-03-09 22:15:54
|
I'm getting a lot (123) of what looks like bogus test failures on a fresh checkout. Are the recent changes to the nstest_http proc OK? |
From: Vlad S. <vl...@cr...> - 2006-03-09 22:25:09
|
Yes, i noticed this as well, this is because server now can close connection during client sending the body and i tried to put catch around close in all places but still it complains on close. Stephen Deasey wrote: > I'm getting a lot (123) of what looks like bogus test failures on a > fresh checkout. Are the recent changes to the nstest_http proc OK? > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Stephen D. <sd...@gm...> - 2006-03-09 22:39:34
|
On 3/9/06, Vlad Seryakov <vl...@cr...> wrote: > > Stephen Deasey wrote: > > I'm getting a lot (123) of what looks like bogus test failures on a > > fresh checkout. Are the recent changes to the nstest_http proc OK? > > Yes, i noticed this as well, this is because server now can close > connection during client sending the body and i tried to put catch > around close in all places but still it complains on close. This is new behaviour? Why would the server close the connection while the client is sending data? I'm getting in failures in e.g. test/url2file.test:url2file-2.1 which looks like: test url2file-2.1 {ns_url2file} -setup { ns_register_proc GET /url2file {ns_return 200 text/plain [ns_url2file /foo] ;#} } -body { nstest_http -getbody 1 GET /url2file } -cleanup { ns_unregister_proc GET /url2file } -result [list 200 [ns_pagepath foo]] This is just a simple GET request, no body. Test error is: ---- Test generated error; Return code was: 1 ---- Return code should have been one of: 0 2 ---- errorInfo: can not find channel named "sock24" while executing "close $wfd" invoked from within "nstest_http -getbody 1 GET /url2file" ("uplevel" body line 2) invoked from within "uplevel 1 $script" ---- errorCode: NONE =3D=3D=3D=3D url2file-2.1 FAILED |
From: Vlad S. <vl...@cr...> - 2006-03-09 22:44:08
|
It should close only when post limit exceeds, other requests should not be affected. It looks like broke something Stephen Deasey wrote: > On 3/9/06, Vlad Seryakov <vl...@cr...> wrote: >> Stephen Deasey wrote: >>> I'm getting a lot (123) of what looks like bogus test failures on a >>> fresh checkout. Are the recent changes to the nstest_http proc OK? >> Yes, i noticed this as well, this is because server now can close >> connection during client sending the body and i tried to put catch >> around close in all places but still it complains on close. > > > This is new behaviour? Why would the server close the connection > while the client is sending data? > > I'm getting in failures in e.g. test/url2file.test:url2file-2.1 which > looks like: > > > test url2file-2.1 {ns_url2file} -setup { > ns_register_proc GET /url2file {ns_return 200 text/plain > [ns_url2file /foo] ;#} > } -body { > nstest_http -getbody 1 GET /url2file > } -cleanup { > ns_unregister_proc GET /url2file > } -result [list 200 [ns_pagepath foo]] > > > This is just a simple GET request, no body. Test error is: > > > ---- Test generated error; Return code was: 1 > ---- Return code should have been one of: 0 2 > ---- errorInfo: can not find channel named "sock24" > while executing > "close $wfd" > invoked from within > "nstest_http -getbody 1 GET /url2file" > ("uplevel" body line 2) > invoked from within > "uplevel 1 $script" > ---- errorCode: NONE > ==== url2file-2.1 FAILED > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Vlad S. <vl...@cr...> - 2006-03-09 22:50:01
|
Setting this removed all errors: set line [string trim [_ns_http_gets $timeout $rfd]] Before that _ns_http_gets returned \r in the string Vlad Seryakov wrote: > It should close only when post limit exceeds, other requests should not > be affected. It looks like broke something > > Stephen Deasey wrote: >> On 3/9/06, Vlad Seryakov <vl...@cr...> wrote: >>> Stephen Deasey wrote: >>>> I'm getting a lot (123) of what looks like bogus test failures on a >>>> fresh checkout. Are the recent changes to the nstest_http proc OK? >>> Yes, i noticed this as well, this is because server now can close >>> connection during client sending the body and i tried to put catch >>> around close in all places but still it complains on close. >> >> >> This is new behaviour? Why would the server close the connection >> while the client is sending data? >> >> I'm getting in failures in e.g. test/url2file.test:url2file-2.1 which >> looks like: >> >> >> test url2file-2.1 {ns_url2file} -setup { >> ns_register_proc GET /url2file {ns_return 200 text/plain >> [ns_url2file /foo] ;#} >> } -body { >> nstest_http -getbody 1 GET /url2file >> } -cleanup { >> ns_unregister_proc GET /url2file >> } -result [list 200 [ns_pagepath foo]] >> >> >> This is just a simple GET request, no body. Test error is: >> >> >> ---- Test generated error; Return code was: 1 >> ---- Return code should have been one of: 0 2 >> ---- errorInfo: can not find channel named "sock24" >> while executing >> "close $wfd" >> invoked from within >> "nstest_http -getbody 1 GET /url2file" >> ("uplevel" body line 2) >> invoked from within >> "uplevel 1 $script" >> ---- errorCode: NONE >> ==== url2file-2.1 FAILED >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by xPML, a groundbreaking scripting >> language >> that extends applications into web and mobile media. Attend the live >> webcast >> and join the prime developer group breaking into this new coding >> territory! >> http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 >> _______________________________________________ >> naviserver-devel mailing list >> nav...@li... >> https://lists.sourceforge.net/lists/listinfo/naviserver-devel >> > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Stephen D. <sd...@gm...> - 2006-03-09 23:13:11
|
Zoran! Why do you hate my test suite? :-) RCS file: /cvsroot/naviserver/naviserver/tcl/http.tcl,v date: 2006/03/09 11:25:55; author: vasiljevic; state: Exp; lines: +356 -= 312 ...The http.tcl and sendmail.tcl are rewritten to take advantage of automatic end-of-line handling of Tcl channels... proc _ns_http_gets {timeout sock} { - set line "" - set done 0 - while {!$done} { - set nline [_ns_http_readable $timeout $sock] - if {!$nline} {set done 1} - while {!$done && $nline > 0} { - set char [read $sock 1] - if {$char eq "\n"} {set done 1} - append line $char - incr nline -1 - } + + while {[gets $sock line] =3D=3D -1} { + if {[eof $sock]} { + return -code error "_hs_http_gets: premature end of data" + } + _ns_http_readable $timeout $sock } - string trimright $line + + return $line } On 3/9/06, Vlad Seryakov <vl...@cr...> wrote: > Setting this removed all errors: > > set line [string trim [_ns_http_gets $timeout $rfd]] > > Before that _ns_http_gets returned \r in the string > > Vlad Seryakov wrote: > > It should close only when post limit exceeds, other requests should not > > be affected. It looks like broke something > > > > Stephen Deasey wrote: > >> On 3/9/06, Vlad Seryakov <vl...@cr...> wrote: > >>> Stephen Deasey wrote: > >>>> I'm getting a lot (123) of what looks like bogus test failures on a > >>>> fresh checkout. Are the recent changes to the nstest_http proc OK? > >>> Yes, i noticed this as well, this is because server now can close > >>> connection during client sending the body and i tried to put catch > >>> around close in all places but still it complains on close. > >> > >> > >> This is new behaviour? Why would the server close the connection > >> while the client is sending data? > >> > >> I'm getting in failures in e.g. test/url2file.test:url2file-2.1 which > >> looks like: > >> > >> > >> test url2file-2.1 {ns_url2file} -setup { > >> ns_register_proc GET /url2file {ns_return 200 text/plain > >> [ns_url2file /foo] ;#} > >> } -body { > >> nstest_http -getbody 1 GET /url2file > >> } -cleanup { > >> ns_unregister_proc GET /url2file > >> } -result [list 200 [ns_pagepath foo]] > >> > >> > >> This is just a simple GET request, no body. Test error is: > >> > >> > >> ---- Test generated error; Return code was: 1 > >> ---- Return code should have been one of: 0 2 > >> ---- errorInfo: can not find channel named "sock24" > >> while executing > >> "close $wfd" > >> invoked from within > >> "nstest_http -getbody 1 GET /url2file" > >> ("uplevel" body line 2) > >> invoked from within > >> "uplevel 1 $script" > >> ---- errorCode: NONE > >> =3D=3D=3D=3D url2file-2.1 FAILED |
From: Zoran V. <zv...@ar...> - 2006-03-10 08:57:11
|
Am 10.03.2006 um 00:13 schrieb Stephen Deasey: > Zoran! Why do you hate my test suite? :-) > I dont! I just keep forget to run the damn thing BEFORE I checkin! I run it for some weird reason always AFTER. Yes, I noticed that yesterday very late and did not bother th fix it until today. Sorry. I must work on my bad habit! Cheers Zoran |
From: Zoran V. <zv...@ar...> - 2006-03-10 09:23:30
|
Am 10.03.2006 um 00:13 schrieb Stephen Deasey: > Zoran! Why do you hate my test suite? :-) > > > RCS file: /cvsroot/naviserver/naviserver/tcl/http.tcl,v > date: 2006/03/09 11:25:55; author: vasiljevic; state: Exp; > lines: +356 -312 > > ...The http.tcl and sendmail.tcl are rewritten to take advantage of > automatic end-of-line handling of Tcl channels... > Since WHEN we are supporting "_ns_" as part of the API? This is in testtinghttp.tcl: if {[string equal $http ""]} { set request "$method $url\r" } else { set request "$method $url HTTP/$http\r" } _ns_http_puts $timeout $wfd $request ; ###################### for {set i 0} {$i < [ns_set size $hdrs]} {incr i} { Yes, I have modified http.tcl/sendmail.tcl code given the fact that Tcl will perfectly well handle the network-line-break with on-board tools. But I did not expect anybody using internal helper procedures from outside. I guess the simple and easy fix to that is to: a. provide complete custom support for http conns in testtinghttp.tcl b. trash it entirely and use standard ns_httpget I will opt for the a. for the moment and fix this in about 15 minutes. Please: do not use non API calls in the future. Cheers Zoran |