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

Sylvain Lebresne commented on CASSANDRA-11635:
----------------------------------------------

Ok, I got confused because I was running the test as part of the normal {{ant 
test}} target, and was looking at a job failure on CI, but it's actually the 
specific {{ant test-clientutil-jar}} target, which is run by CI but whose 
failure doesn't seem to be reported (as far as I can tell, and unless you 
manually check the console output).

Anyway, the original error message with Sigar actually makes sense: we did make 
sigar a dependency of UUIDGen and forgot to add it to the {{clientutil.jar}}. 
That's still the error with which the test fails on 2.2 and 3.0 and I'm 
attaching below simple update to fix the test. I didn't bother running CI 
because it only changes the build file, and only the target related to 
{{clientutil.java}}, which as said above is not even reported by CI. It's easy 
enough to check locally that it fixes the test though.

| [11635-2.2|https://github.com/pcmanus/cassandra/commits/11635-2.2] |
| [11635-3.0|https://github.com/pcmanus/cassandra/commits/11635-3.0] |

It does is worth noting that the inclusion of sigar will make the use of 
clientutil.jar a tad more annoying as you need to put sigar's binary for your 
architecture. Or more precisely, you don't _need_ to, but you'll get an ugly 
error message if you don't. I'm not entirely sure clientutil.jar is still in 
use though, and as I said, it's not actually mandatory, so I'm not convinced 
it's a problem, but still mentioning it for completness.

Now, that leaves the issue on trunk (or 3.9 for that matter). And I'm not 
entirely sure why the test complains about {{IPartitioner}}. What I do know is 
that the reason it complains on 3.x and not on 3.0.x is CASSANDRA-12002. For 
some reason, the code that patch added to {{FBUtilities}} triggers the problem 
(the test pass if I revert those changes). Which is weird in the sense that 
those change only included 2 new methods returning {{IPartitioner}} but there 
already has one before. I'm not an expert in class loaders though.

Anyway, I'm not sure what is the right fix for 3.x. I could try to randomly 
bend the code in {{FBUtilities}} to make the test happy, or move that code 
somewhere else (even more random), or spend a few hours understanding the 
subtlety of the class loader, but as I said above, I'm not really sure 
clientutil.java is used anywhere anymore as the functionality it offers is 
provided by other clients, and those other clients don't use it. So I'm 
seriously wondering if the most progmatic solution isn't to just stop providing 
that jar in 3.x (and if you really depend on that jar, you're probably better 
off sticking to an old version anyway). Any opinions?


> test-clientutil-jar unit test fails
> -----------------------------------
>
>                 Key: CASSANDRA-11635
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11635
>             Project: Cassandra
>          Issue Type: Test
>          Components: Testing
>            Reporter: Michael Shuler
>            Assignee: Sylvain Lebresne
>              Labels: unittest
>             Fix For: 2.2.x, 3.0.x, 3.x
>
>
> {noformat}
> test-clientutil-jar:
>     [junit] Testsuite: org.apache.cassandra.serializers.ClientUtilsTest
>     [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 
> 0.314 sec
>     [junit] 
>     [junit] Testcase: test(org.apache.cassandra.serializers.ClientUtilsTest): 
>   Caused an ERROR
>     [junit] org/apache/cassandra/utils/SigarLibrary
>     [junit] java.lang.NoClassDefFoundError: 
> org/apache/cassandra/utils/SigarLibrary
>     [junit]     at org.apache.cassandra.utils.UUIDGen.hash(UUIDGen.java:328)
>     [junit]     at 
> org.apache.cassandra.utils.UUIDGen.makeNode(UUIDGen.java:307)
>     [junit]     at 
> org.apache.cassandra.utils.UUIDGen.makeClockSeqAndNode(UUIDGen.java:256)
>     [junit]     at 
> org.apache.cassandra.utils.UUIDGen.<clinit>(UUIDGen.java:39)
>     [junit]     at 
> org.apache.cassandra.serializers.ClientUtilsTest.test(ClientUtilsTest.java:56)
>     [junit] Caused by: java.lang.ClassNotFoundException: 
> org.apache.cassandra.utils.SigarLibrary
>     [junit]     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
>     [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>     [junit]     at 
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
>     [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>     [junit] 
>     [junit] 
>     [junit] Test org.apache.cassandra.serializers.ClientUtilsTest FAILED
> BUILD FAILED
> {noformat}
> I'll see if I can find a spot where this passes, but it appears to have been 
> failing for a long time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to