Re: [siesta-dev] Failed tests and some warnings, patches attached

[prev] [thread] [next] [lurker] [Date index for 2004/06/02]

From: Richard Clamp
Subject: Re: [siesta-dev] Failed tests and some warnings, patches attached
Date: 14:35 on 02 Jun 2004
On Fri, May 21, 2004 at 02:14:16PM +0100, Andy Wardley wrote:
> I'm seeing some errors when trying to install Siesta.  I've tried both 
> 0.65 from CPAN and the latest snapshot from the web site.
> First, I was getting some warnings.  Class::DBI (0.96) was warning about
> the 'sort' parameter being deprecated in favour of 'order_by'.  The first
> patch attached makes the change, although it will presumably break 
> compatability with pre-0.96 Class:DBI.

Sassen frassen Class::DBI.

> I was also seeing some warnings from line 127 of because 
> $Siesta::Config::LOG_LEVEL was undefined, due to the fact that I don't
> have a /usr/local/siesta/siesta.conf file yet.
> The second patch changes to call a setup method to set
> the package variable to their default values even if the config file
> doesn't exist.  I created a new setup() method but left the original 
> load_from() intact, just in case it's currently being used in other 
> parts of code.  I also added C<use Siesta::Config> to, as
> implemented in the third patch.  I suspect that this may not be the
> right thing to do, but it seems to solve the immediate problem.

Hrm.  Most of that will have been oboleted by the recent work I did
as patches #1505-1510  I'm afraid.

> Now, having got all that out of the way, I'm still seeing a couple of
> errors.
> Failed Test        Stat Wstat Total Fail  Failed  List of Failed
> -------------------------------------------------------------------------------
> t/09defer.t         255 65280    22    6  27.27%  17-22
> t/09plugin_order.t  255 65280    11    2  18.18%  10-11
> t/20fullsend.t        2   512     1    1 100.00%  1
> Failed 3/18 test scripts, 83.33% okay. 9/222 subtests failed, 95.95% okay.
> The first two fail with a Class::DBI call_trigger() method failure.
> t/09defer...................ok 16/22Can't locate object method "call_trigger" via package "Class::DBI::Object::Has::Been::Deleted" at /usr/local/lib/perl5/site_perl/5.8.0/Class/ line 723, <DATA> line 12.
> t/09plugin_order............ok 9/11Can't locate object method "call_trigger" via package "Class::DBI::Object::Has::Been::Deleted" at /usr/local/lib/perl5/site_perl/5.8.0/Class/ line 723.
> The third complains thusly:
> t/20fullsend................Siesta::Plugin::process called directly at /home/abw/projects/siesta/Siesta-0.65-abw/blib/lib/Siesta/ line 44.
> A cursory glance at the code for either of these problems doesn't offer
> any enlightenment.  I suspect the Class::DBI problem is another version
> compatibility problem, but I can't track it down.  
> Any clues gratefully received.  It looks like most of it works so I'll 
> press on.

I've just took a quick stab on a clean perl with the lastest release
of everything, and suspect that this is a bug in the new Class::DBI
caching code.

From the 0.96 Changes file.


  New Functionality
    - Maintain live object index so subsequent requests for same row return 
      the same object (Perrin Harkins)

Now without hunting down that code I think it's showing up because of
an 'interesting' quirk in SQLites auto-incrementing id columns.
Rather than being a true sequence, it just finds the maximum value for
the key, and adds 1 to it.  This means you see patterns like this:

INSERT INTO foo (bar) VALUES ('baz');
 mysql | SQLite
     1 | 1

INSERT INTO foo (bar) VALUES ('baz');
 mysql | SQLite
     1 | 1
     2 | 2

 mysql | SQLite
     1 | 1

INSERT INTO foo (bar) VALUES ('baz');
 mysql | SQLite
     1 | 1
     3 | 2

Then all you need is for that object index to be really naiive and
sticky, and keep the version that gets blessed into
'Class::DBI::Has::Been::Deleted' when you called ->delete on it and
foop - big bang!

Certainly the 09defer.t would tickle this.

When I get a tuit I'll get onto either Tony or the Class::DBI::SQLite

Richard Clamp <>

Generated at 13:56 on 01 Jul 2004 by mariachi 0.52