Skip Menu |

This queue is for tickets about the CGI-Application CPAN distribution.

Report information
The Basics
Id: 37435
Status: rejected
Priority: 0/
Queue: CGI-Application

Owner: MARKSTOS [...]
Requestors: ts [...]

Bug Information
Severity: Important
Broken in:
  • 4.07_03
  • 4.10
Fixed in: 4.06

Subject: 'make test' fails when $HEADERS_ONCE of globals modified
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 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 setting upon CGI install, then the CGI-Application install succeeds. Default installs of 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'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
Download (untitled) / with headers
text/plain 827b
After consulting with some other CGI::Application users, we are declaring this "not our bug" and will not be modifying the test suite to address it. Using global variables is not considered good interface design precisely because it creates "action at a distance" bugs like this that are hard to track down. Just the other day I spent several hours tracking down a bug that was due to $CGI::POST_MAX being used in a far-away module. The fact that we pass the tests with the default settings. If you change them, it's your responsibility for understanding how that might affect interactions with other modules. That said, if you feel strongly that modifying the CGI::App test suit would be "correct", I would consider looking at a patch that makes the test suite work with and without this global variable change.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to