You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Paul Makepeace <ap...@paulm.com> on 2003/12/29 14:17:11 UTC

Apache::DBI tests failing

Hi,

Apache::DBI doesn't seem to be caching connections here causing a test
failure. I'm using Debian/unstable, Debian's perl 5.8.2, mysql 4.0.16,
DBD::mysql 2.9003, and CPAN's DBI 1.39. (DBI warned about perl having
threading enabled, FWIW.)

Any ideas what could be the problem?

fourme:/var/tmp/cpan/build/Apache-DBI-0.92# perl -Mlib=blib/lib t/10mysql.t 
1..7
ok 1 - use Apache::DBI;
ok 2 - DBD::mysql loaded
ok 3 - Connected 1
ok 4 - Connected 2
not ok 5 - got the same connection both times
#     Failed test (t/10mysql.t at line 35)
#          got: '137'
#     expected: '138'


Here is a small patch to make the diagnostic slightly more meaningful,

--- t/10mysql.t.old     2003-12-29 13:09:49.000000000 +0000
+++ t/10mysql.t 2003-12-29 13:09:57.000000000 +0000
@@ -34,3 +34,3 @@
 
-    is($thread_1, $thread_2, "got the same connection both times");
+    is($thread_2, $thread_1, "got the same connection both times");

Thanks, Paul

-- 
Paul Makepeace ................................  http://paulm.com/ecademy

"What is your haddock called? 42."
   -- http://paulm.com/toys/surrealism/

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Apache::DBI tests failing

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Paul Makepeace wrote:
> Hi,
> 
> Apache::DBI doesn't seem to be caching connections here causing a test
> failure. I'm using Debian/unstable, Debian's perl 5.8.2, mysql 4.0.16,
> DBD::mysql 2.9003, and CPAN's DBI 1.39. (DBI warned about perl having
> threading enabled, FWIW.)
> 
> Any ideas what could be the problem?

after playing around a bit with this, it looks like the test isn't calling
Apache::DBI at all.

the attached patch adds some simple tests to make sure that the database
handles being compared actually come from Apache::DBI - they don't for me
using the latest DBI and DBD::mysql.  once the BEGIN logic is changed,
though, all the tests (old and new) pass just fine.

Apache-Test would be a perfect fit for this module ;)

--Geoff