[cgiapp] bug report: 'make test' fails when $HEADERS_ONCE of CGI.pm globals modified

Mark Stosberg mark at summersault.com
Mon Jul 7 15:10:35 EDT 2008


Here we have one of the extremely rare CGI::Application bug reports. 

Someone has modified a CGI.pm global, which is why the tests are
failing. 

I have some inclination to consider this "not our bug". For someone who
has modified these globals, it may in fact be useful feedback to know to
that CGI::Application behaves different than usual in that case, and
thus it's appropriate for the tests to fail. 


Alternatively, we could force lots of CGI.pm globals back to their
default state in state in the test suite. 

Thoughts?

   Mark



From: "Todd Sherman via RT" <bug-CGI-Application at rt.cpan.org>
To: undisclosed-recipients:;
Subject: [rt.cpan.org #37435] 'make test' fails when $HEADERS_ONCE of CGI.pm globals modified 
Date: Sat, 05 Jul 2008 07:36:27 -0400
Reply-To: bug-CGI-Application at rt.cpan.org

Sat Jul 05 07:36:25 2008: Request 37435 was acted upon.
Transaction: Ticket created by Spathiphyllum
       Queue: CGI-Application
     Subject: 'make test' fails when $HEADERS_ONCE of CGI.pm globals modified
   Broken in: 4.07_03, 4.10
    Severity: Important
       Owner: Nobody
  Requestors: ts at histosoft.com
      Status: new
 Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=37435 >


Hi.

A generic failure occurs when 'make test' is performed. Three tests fail:

t/basic.....................1/110
#   Failed test 'base class response (header match)'
#   at t/basic.t line 26.
.
.<HTML output snippage>
.
#     doesn't match '(?-xism:^Content-Type: text/html)'
Use of uninitialized value in pattern match (m//) at t/basic.t line 27.
#   Failed test 'base class response (body match)'
#   at t/basic.t line 27.
#                   undef
#     doesn't match '(?-xism:Query Environment:)'
# Looks like you failed 2 tests of 110.
t/basic..................... Dubious, test returned 2 (wstat 512, 0x200)
 Failed 2/110 subtests
.
.
.
t/header_props..............1/6
#   Failed test 'headed added via hashref arg to header_add'
#   at t/header_props.t line 59.
.
.<HTML output snippage>
.
#     doesn't match '(?mi-xs:^Expires: )'
# Looks like you failed 1 test of 6.
t/header_props.............. Dubious, test returned 1 (wstat 256, 0x100)
 Failed 1/6 subtests
.
.

The server information follows though the issue, as noted, is generic:

Distribution: CGI-Application-4.10 and lower until -4.06
Perl: 5.8.x
OS: Linux 2.6.9-67.0.15.ELsmp

It would appear that if one changes a particular global setting in
CGI.pm that the headers generated by the CGI-Application test suite,
specifically 't/basic.t' and 't/header_props.t', either are not produced
or do not match what the test expects during a regex check.

If HTTP headers are configured as '$HEADERS_ONCE = 1;' under the
subroutine 'initialize_globals', then the 'make test' for
CGI-Application fails. If HTTP headers are configured as '$HEADERS_ONCE
= 0;', which is the default CGI.pm setting upon CGI install, then the
CGI-Application install succeeds. Default installs of CGI.pm will not
introduce this bug, so most users will not experience this 'make' error
when CGI-Application is subsequently installed. However, for those who
have modified CGI.pm's globals, this workaround will help one to add
CGI-Application to their module repository.

I hope this helps and thanks for maintaining CGI-Application.

TS




More information about the cgiapp mailing list