Skip to content

Fixes for broken unit tests issue #107 #108

Closed
wants to merge 3 commits into from

3 participants

@Aaronontheweb

We were able to isolate the issue to the TimeUUID tests - the fixes applied to the attached commits enable 50+ more unit tests to pass than were passing previously.

#107

Aaronontheweb added some commits Jan 22, 2013
@Aaronontheweb Aaronontheweb Fixed a typo bug in the CassandraDatabaseSetup.cs program 18e36e2
@Aaronontheweb Aaronontheweb Fixed the TimeUUID tests by explicitly setting the column name to a G…
…uidGenerator TimeUUID - otherwise the Guid values would be different on read vs. write and Cassandra would return an error upon recv_get
4e55e64
@Aaronontheweb Aaronontheweb Merge pull request #1 from Aaronontheweb/master
Unit tests all pass, magically
f9bdadb
@caglarmarkedup

Basically all the test fails right after the Save_DateTime_Local test. This test basically poisons the connection for the other tests which make them fail. The issue is I think on the conversion of the DateTime, somehow it gets screwed up when you convert them to the byte level. The creation of the column goes fine but on the read request it dies out because cassandra can't return the correct value. Please do look at Cassandra.cs Line 631 and following function recv_get() at this point Cassandra returns an exception. These are the values that get added to the DB.
Row Key Columns

Test1 2010-11-20 08:00:00 UTC: @\x09!\xfbTD-\x18

@nberardi

This doesn't really fix the test. You changed the test so it would break anymore. There is still a casting issue tat needs to be resolved.

@nberardi

@caglarmarkddup Cassandra.cs is generated by thrift so we can't touch it. Often it looks like issues are coming from here because this is where exceptions get thrown from. But it throws exceptions on Cassandra's direction. So the issue must be somewhere else.

Also make sure you set Cassandra up using Java 6. Java 7 breaks Cassandra and thus breaks the tests.

@Aaronontheweb

@nberardi so what exactly is the casting issue? We could tell that there was a problem and we followed it all the way through but it wasn't clear what the underlying problem was.

On top of that commit 18e36e2 fixes a typo in DatabaseSetup.cs which would cause the test fixture to break.

@nberardi

Typically an issue like you are seeing would boil down to this class.

https://github.com/managedfusion/fluentcassandra/blob/master/src/Types/TimeUUIDTypeConverter.cs

My guess is that since converting to GUID ahead of time works that it has something to do with the byte conversion. Typically date issues boil down to one of two things, the resolution gets truncated and the .NET nano seconds don't match the millisecond resolution that Cassandra loves to use. Or the correct DateTime.Kind isn't picked. This is similar to the DateType issue that we discussed before.

@nberardi

I should explain why I really didn't like these changes better. They essentially just duplicate the Save_Guid test and not really test the ability to save date types. So I would rather have these fixed or at the very worst marked as Skip instead of producing false positives.

@nberardi

This is related to the GuidGenerator changes that were made a while back in issue #66 by @GrLawrence and @dlbromen and myself

06f40800-f463-11df- 9bd9 -12079974fbad

The 2 bytes that I highlighted are getting changed with each request, which makes it unusable because it is constantly regenerating new numbers when you pass in the same date.

@nberardi nberardi closed this in a428fda Jan 25, 2013
@Aaronontheweb

@nberardi makes sense to me - we just wanted the other tests to pass more than anything else; marking those tests as skip makes sense too.

@nberardi

Well I fixed them, but that is just my preference. A passing test is no use if it doesn't actual test what it was designed for. IMO

@Aaronontheweb
@nberardi

Either way we are down to about 23 tests and most of them have to do with CQL. You help is much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.