Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install failing on RHEL 7.6 #276

Closed
ludz-lim opened this issue May 29, 2019 · 3 comments · Fixed by #299
Closed

Install failing on RHEL 7.6 #276

ludz-lim opened this issue May 29, 2019 · 3 comments · Fixed by #299

Comments

@ludz-lim
Copy link

ludz-lim commented May 29, 2019

I'm getting the following error message when installing WWW::Mechanize on a RHEL7 machine using cpanm

t/frames.t ............................... ok

   Failed test '... and it was recorded in the history'
 at t/history.t line 131.
      got: '3'
   expected: '2'
 Looks like you failed 1 test of 28.
t/history.t ..............................
@oalders
Copy link
Member

oalders commented May 29, 2019

Do you have something running on localhost:80?

With this diff:

diff --git a/t/history.t b/t/history.t
index ee877be..b9b09ef 100644
--- a/t/history.t
+++ b/t/history.t
@@ -133,6 +133,8 @@ BEGIN {
         $mech->history(0)->{req}->uri, qr/localhost/,
         "... and the correct request was saved"
     );
+    use DDP;
+    diag np $mech->history;
 }

I see:

Use of uninitialized value $n in numeric eq (==) at /Users/olafalders/Documents/github/WWW-Mechanize/lib/WWW/Mechanize.pm line 620.
# \ {
#     req   HTTP::Request  {
#         Parents       HTTP::Message
#         public methods (9) : accept_decodable, as_string, clone, dump, method, new, parse, uri, uri_canonical
#         private methods (0)
#         internals: {
#             _content   "",
#             _headers   HTTP::Headers,
#             _method    "POST",
#             _uri       URI::http
#         }
#     },
#     res   HTTP::Response  {
#         Parents       HTTP::Message
#         public methods (24) : as_string, base, clone, code, current_age, dump, error_as_HTML, filename, fresh_until, freshness_lifetime, is_client_error, is_error, is_fresh, is_info, is_redirect, is_server_error, is_success, message, new, parse, previous, redirects, request, status_line
#         private methods (0)
#         internals: {
#             _content   "Can't connect to localhost:80
#
# Connection refused at /Users/olafalders/.plenv/versions/5.26.1/lib/perl5/site_perl/5.26.1/LWP/Protocol/http.pm line 46.
# ",
#             _headers   HTTP::Headers,
#             _msg       "Can't connect to localhost:80",
#             _rc        500,
#             _request   var{req}
#         }
#     }
# }

So, it looks like the test just assumes that there's no web server running and that a failure will end up in the history. We should change that POST to a local file GET or something similar. Just wondering if that's what happening in your case.

@ludz-lim
Copy link
Author

I have Apache running on that machine. I was able to install WWW:Mechanize after stopping apache.

@genehack
Copy link

FWIW, I'm currently being bitten by this same failing test. Current Debian, running Nginx on port 80.

Changing the t/history_2.html file so that the form target was http://localhost:6667 allowed the test to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants