cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-3864) Unit tests failures in 1.1
Date Wed, 08 Feb 2012 14:58:04 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-3864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13203651#comment-13203651
] 

Sylvain Lebresne commented on CASSANDRA-3864:
---------------------------------------------

That's weird, as I still get it every time.
But actually I think that is a bit dependent on the class loader, so this may be platform
dependent (I'm using sun java 1.6.0_26).

In any case, I think there do is something fishy in there. Namely, BulkRecordWriter override
the global configuration in it's static initializer. And the config it override with has data_file_directories
== null. Which means that if the class Table is loaded after that, it will try to create default
directories as part of the class initialization (unless StorageService.isClientMode == true)
and will throw a NPE because data_file_directories == null. I'm not too sure in which context
exactly BulkRecordWriter is supposed to be used, but outside of making the unit test fail
at least on my machine, it does sound fairly fragile.
Of course, that's another way to say that all our static initialization business is fragile,
and we should fix that someday. Nevertheless, would it be reasonable for instance in BulkLoaderWriter
to call something to set StorageService.isClientMode to true before changing the configuration
(so that if Table is loaded later, we don't try to create the default directories)? 
                
> Unit tests failures in 1.1
> --------------------------
>
>                 Key: CASSANDRA-3864
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3864
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Sylvain Lebresne
>            Assignee: Brandon Williams
>         Attachments: 0001-Fix-DefsTest.patch, 0002-Fix-SSTableImportTest.patch, 0003-Fix-CompositeTypeTest.patch
>
>
> On the current 1.1 branch I get the following errors:
> # SSTableImportTest:
> {noformat}
> [junit] Testcase: testImportSimpleCf(org.apache.cassandra.tools.SSTableImportTest):	Caused
an ERROR
> [junit] java.lang.Integer cannot be cast to java.lang.Long
> [junit] java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
> [junit] 	at org.apache.cassandra.tools.SSTableImport$JsonColumn.<init>(SSTableImport.java:132)
> [junit] 	at org.apache.cassandra.tools.SSTableImport.addColumnsToCF(SSTableImport.java:191)
> [junit] 	at org.apache.cassandra.tools.SSTableImport.addToStandardCF(SSTableImport.java:174)
> [junit] 	at org.apache.cassandra.tools.SSTableImport.importUnsorted(SSTableImport.java:290)
> [junit] 	at org.apache.cassandra.tools.SSTableImport.importJson(SSTableImport.java:255)
> [junit] 	at org.apache.cassandra.tools.SSTableImportTest.testImportSimpleCf(SSTableImportTest.java:60)
> {noformat}
> # CompositeTypeTest:
> {noformat}
> [junit] Testcase: testCompatibility(org.apache.cassandra.db.marshal.CompositeTypeTest):
Caused an ERROR
> [junit] Invalid comparator class org.apache.cassandra.db.marshal.CompositeType: must
define a public static instance field or a public static method getInstance(TypeParser).
> [junit] org.apache.cassandra.config.ConfigurationException: Invalid comparator class
org.apache.cassandra.db.marshal.CompositeType: must define a public static instance field
or a public static method getInstance(TypeParser).
> [junit] 	at org.apache.cassandra.db.marshal.TypeParser.getRawAbstractType(TypeParser.java:294)
> [junit] 	at org.apache.cassandra.db.marshal.TypeParser.getAbstractType(TypeParser.java:268)
> [junit] 	at org.apache.cassandra.db.marshal.TypeParser.parse(TypeParser.java:81)
> [junit] 	at org.apache.cassandra.db.marshal.CompositeTypeTest.testCompatibility(CompositeTypeTest.java:216)
> {noformat}
> # DefsTest:
> {noformat}
> [junit] Testcase: testUpdateColumnFamilyNoIndexes(org.apache.cassandra.db.DefsTest):
FAILED
> [junit] Should have blown up when you used a different comparator.
> [junit] junit.framework.AssertionFailedError: Should have blown up when you used a different
comparator.
> [junit] 	at org.apache.cassandra.db.DefsTest.testUpdateColumnFamilyNoIndexes(DefsTest.java:539)
> {noformat}
> # CompactSerializerTest:
> {noformat}
> [junit] null
> [junit] java.lang.ExceptionInInitializerError
> [junit] 	at org.apache.cassandra.db.SystemTable.getCurrentLocalNodeId(SystemTable.java:437)
> [junit] 	at org.apache.cassandra.utils.NodeId$LocalNodeIdHistory.<init>(NodeId.java:195)
> [junit] 	at org.apache.cassandra.utils.NodeId$LocalIds.<clinit>(NodeId.java:43)
> [junit] 	at java.lang.Class.forName0(Native Method)
> [junit] 	at java.lang.Class.forName(Class.java:169)
> [junit] 	at org.apache.cassandra.io.CompactSerializerTest$1DirScanner.scan(CompactSerializerTest.java:96)
> [junit] 	at org.apache.cassandra.io.CompactSerializerTest$1DirScanner.scan(CompactSerializerTest.java:87)
> [junit] 	at org.apache.cassandra.io.CompactSerializerTest$1DirScanner.scan(CompactSerializerTest.java:87)
> [junit] 	at org.apache.cassandra.io.CompactSerializerTest$1DirScanner.scan(CompactSerializerTest.java:87)
> [junit] 	at org.apache.cassandra.io.CompactSerializerTest$1DirScanner.scan(CompactSerializerTest.java:87)
> [junit] 	at org.apache.cassandra.io.CompactSerializerTest$1DirScanner.scan(CompactSerializerTest.java:87)
> [junit] 	at org.apache.cassandra.io.CompactSerializerTest.scanClasspath(CompactSerializerTest.java:129)
> [junit] Caused by: java.lang.NullPointerException
> [junit] 	at org.apache.cassandra.config.DatabaseDescriptor.createAllDirectories(DatabaseDescriptor.java:574)
> [junit] 	at org.apache.cassandra.db.Table.<clinit>(Table.java:82)
> {noformat}
> There is also some error RemoveSubColumnTest and RemoveSubColumnTest but I'll open a
separate ticket for those as they may require a bit more discussion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message