Possible bug with Voyage-Mongo date

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible bug with Voyage-Mongo date

raphonic
I'm running Pharo 3.0 beta with Voyage-Mongo. When I save a DateAndTime instance in the database, it's saved in Mongodb as the previous day. This occurs for all dates.

This could be an issue with either the Mongo driver or Voyage-Mongo, i'm not exactly sure which since both their tests pass.
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug with Voyage-Mongo date

raphonic
I just ran the entire test suite for Pharo and it seems that the problem isn't with voyage or the mongo test driver. The
DateTest>#testDuration test failed with this message 'Got 37641:18:30:00 instead of 1:00:00:00'. I'm running the latest pharo3.0 vm and image on Ubuntu 12 x86. Anyone know what could be the problem?
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug with Voyage-Mongo date

Sven Van Caekenberghe-2

On 10 Jan 2014, at 08:18, raphonic <[hidden email]> wrote:

> I just ran the entire test suite for Pharo and it seems that the problem
> isn't with voyage or the mongo test driver. The
> DateTest>#testDuration test failed with this message 'Got 37641:18:30:00
> instead of 1:00:00:00'. I'm running the latest pharo3.0 vm and image on
> Ubuntu 12 x86. Anyone know what could be the problem?

That seems very weird: it basically says that the duration of a Date, which should be one day, 24 hours, is totally wrong !

What do you get if you do

  Date today duration.

  (Date readFrom: '01-23-2004' readStream) duration.

I think one of the packages you loaded did some override in Chronology and broke stuff.

Sven
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug with Voyage-Mongo date

raphonic
For

   Date today duration, I got '41281:18:30:00'

and for (Date readFrom: '01-23-2004' readStream) duration: '37641:18:30:00'.

I've loaded only a few packages over the default image
Seaside3(3.1)
VoyageMongo,
JSON

I'm currently looking at the Date class to see if some package overrides any methods.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug with Voyage-Mongo date

raphonic
In reply to this post by Sven Van Caekenberghe-2
Mongo-BSON was the package overriding duration. It over-rode duration's accessor with

duration
        ^Duration seconds: self asSeconds  nanoSeconds: 0