twt::do_request (public)
twt::do_request page_url
Defined in packages/acs-automated-testing/tcl/tclwebtest-procs.tcl
Takes a URL and invokes tclwebtest::do_request. Will retry the request a number of times if it fails because of a socket connect problem.
- Parameters:
- page_url (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: aa_log "twt::do_request $page_url" # Qualify page_url if necessary if { [regexp {^/} $page_url] } { set page_url [acs::test::url]${page_url} } set retry_count 0 set retry_max 10 set error_p 0 while { [catch {::tclwebtest::do_request $page_url} errmsg] } { set error_p 1 if { $retry_count < $retry_max } { switch -regexp -- $errmsg { {unreachable} - {refused} { ::twt::log "Failed to connect to server with error \"$errmsg\" - retrying" incr retry_count ns_sleep 5s set error_p 0 continue } default { ::twt::log "Failed to connect to server with error \"$errmsg\" - giving up" break } } } else { break } } if { $error_p } { # Either some non-socket error, or a socket problem occurring with more than # $retry_max times. Propagate the error while retaining the stack trace aa_log "twt::do_request failed with error=\"$errmsg\" response_url=\"[tclwebtest::response url]\". See error log for the HTML response body" ns_log Error "twt::do_request failed with error=\"$errmsg\" response_url=\"[tclwebtest::response url]\" response_body=\"[tclwebtest::response body]\"" error $errmsg $::errorInfo }XQL Not present: Generic, PostgreSQL, Oracle