I'm very confused about this error: jc.DeepEquals

John Meinel john at arbash-meinel.com
Mon Jul 6 07:23:12 UTC 2015


Is it possible the data is accidentally mutable and being updated
asynchronously? Such that at the time the initial comparison is made the
value is actually false, but by the time we notice the mismatch and report
on it the data has been updated and they are now the same? Bad test to
share mutable state between threads/goroutines, though it might be
uncovering a deeper shared state problem?

Or its just something equally weird where we get NaN != NaN, but true !=
true would certainly be very odd.

John
=:->


On Mon, Jul 6, 2015 at 3:35 AM, Tim Penhey <tim.penhey at canonical.com> wrote:

> This morning I noticed a Curse on the jes-cli branch, which included
> this one on ppc64el:
>
>
> http://reports.vapour.ws/releases/2855/job/run-unit-tests-trusty-ppc64el/attempt/3487
>
>
> Upon looking I saw this:
>
> storage_test.go:147:
>     c.Assert(info, jc.DeepEquals, expect)
> ... obtained state.FilesystemAttachmentInfo =
> state.FilesystemAttachmentInfo{MountPoint:"", ReadOnly:true}
> ... expected state.FilesystemAttachmentInfo =
> state.FilesystemAttachmentInfo{MountPoint:"", ReadOnly:true}
> ... mismatch at .ReadOnly: unequal; obtained true; expected true
>
>
> um... wat?
>
> from state/filesystem.go:
>
> type FilesystemAttachmentInfo struct {
>         // MountPoint is the path at which the filesystem is mounted on the
>         // machine. MountPoint may be empty, meaning that the filesystem is
>         // not mounted yet.
>         MountPoint string `bson:"mountpoint"`
>         ReadOnly   bool   `bson:"read-only"`
> }
>
>
> So we have a plain struct with a string and a bool.  How can
> jc.DeepEquals fail with this?
>
> Confusedly yours,
> Tim
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20150706/bdd10e84/attachment.html>


More information about the Juju-dev mailing list