cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Branimir Lambov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7466) Unit Test Suite Breaks when Run in a Single JVM
Date Tue, 07 Oct 2014 09:58:34 GMT

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

Branimir Lambov commented on CASSANDRA-7466:
--------------------------------------------

The reasoning is good, and I don't see any problems with the code.

However, I can't get any improvement in the tests that pass when run under IntelliJ or eclipse,
in Windows or in a virtual Linux box. Windows is known to have a lot more problems running
tests, though, so maybe someone else could confirm that this patch helps?

> Unit Test Suite Breaks when Run in a Single JVM
> -----------------------------------------------
>
>                 Key: CASSANDRA-7466
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7466
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tests
>         Environment: MacOS 10.9.3, IntelliJ IDEA 13.1.3, Java 1.7.0_51
>            Reporter: Caleb William Rackliffe
>            Assignee: Caleb William Rackliffe
>            Priority: Minor
>              Labels: unit-test
>         Attachments: trunk-7466.txt
>
>
> Note: Instead of picking a version below, I'll simply note that I'm on {{trunk}} at commit
{{c027183ea4e901cf1d44e06704f6d78f84405bb4}}
> I pulled down the source and followed http://wiki.apache.org/cassandra/RunningCassandraInIDEA
to import C* as an IDEA project. Everything in the tutorial works as it should, but when I
tried to run the unit tests in {{test/unit/org.apache.cassandra}}, the suite failed a couple
tests in, complaining that it couldn't find the {{system}} keyspace in {{build/test/cassandra/data}}.
> tl;dr static initialization makes it hard to run the unit tests in the same JVM
> The full story is that...
> 1.) When the first test in the suite is run, the {{system}} keyspace is created on disk
and in the in-memory schema.
> 2.) Many subsequent tests, like {{BlacklistingCompactionsTest}}, remove the {{system}}
keyspace directory (among other things) in {{defineSchema()}} with a call to {{SchemaLoader.prepareServer()}}.
> 3.) While these tests create the keyspaces they require, they do *not* recreate the system
keyspace, and so they fail when they force a compaction or perform any other action that goes
looking for it.
> You can run the suite with IDEA's class/method forking, and you get a little bit better
results, but it still seems like this shouldn't be necessary.
> I guess there are two ways to fix it:
> 1.) We rebuild the system keyspace before for each test.
> 2.) We leave the system keyspace alone.
> I took a hack at #1 in the attached patch. It looks like it to fixes this specific problem,
but I'm not super-believable in this codebase yet...



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

Mime
View raw message