Re: Error running 'ant test'

2016-05-19 Thread Oleksandr Petrov
I just tried it locally, `ant clean && ant test
-Dtest.name=TopKSamplerTest` works just fine (tried the other test, too).
What's your JDK version? I can't see anything obvious that is wrong. If the
branch is up-to-date, it usually has to build.


On Thu, May 19, 2016 at 5:12 AM Mahdi Mohammadi  wrote:

> I am trying to run `ant test` on cassandra-3.0 branch but get some errors:
>
> *[junit] Testcase:
>
> testSamplerSingleInsertionsEqualMulti(org.apache.cassandra.utils.TopKSamplerTest):
>FAILED*
> *[junit] expected:<{item2=2, item1=1, item8=8, item7=7, item9=9,
> item4=4, item10=10, item3=3, item6=6, item5=5}> but was:<{item2=2, item1=1,
> item8=8, item7=7, item9=9, item4=4, item3=3, item6=6,*
> *item5=5}>*
> *[junit] junit.framework.AssertionFailedError: expected:<{item2=2,
> item1=1, item8=8, item7=7, item9=9, item4=4, item10=10, item3=3, item6=6,
> item5=5}> but was:<{item2=2, item1=1, item8=8, item7=7,*
> *item9=9, item4=4, item3=3, item6=6, item5=5}>*
> *[junit] at
>
> org.apache.cassandra.utils.TopKSamplerTest.testSamplerSingleInsertionsEqualMulti(TopKSamplerTest.java:39)*
> *[junit]*
>
> Or this one:
>
> *[junit] Testcase:
> executeTriggerOnThriftInsert(org.apache.cassandra.triggers.TriggersTest):
> Caused an ERROR*
> *[junit] Trigger trigger_1 already exists*
> *[junit] org.apache.cassandra.exceptions.InvalidRequestException:
> Trigger trigger_1 already exists*
> *[junit] at
>
> org.apache.cassandra.cql3.statements.CreateTriggerStatement.announceMigration(CreateTriggerStatement.java:85)*
> *[junit] at
>
> org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:93)*
> *[junit] at
>
> org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:206)*
> *[junit] at
> org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:237)*
> *[junit] at
> org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:252)*
> *[junit] at
> org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:247)*
> *[junit] at
> org.apache.cassandra.triggers.TriggersTest.setup(TriggersTest.java:92)*
> *[junit]*
> *[junit]*
>
> Am I missing something?
>
> Best Regards
>
-- 
Alex Petrov


Re: How cassandra ensures consistency when adding or removing a node?

2016-05-19 Thread Oleksandr Petrov
I think that this article [1] covers most of the concepts (see key
concepts) quite well.
I am not aware of any article that explains the whole process, though.

Briefly, there are several processes/concepts that are somewhat related to
that subject: token ownership, replica, coordinator and gossip.
Ensuring consistency in small cluster (amount of replica <= amount of
nodes) is more or less straightforward. In this case, when node bootstraps,
it notifies all the replicas, information about that node gets added to
`pending nodes`, all nodes know about the bootstrapping node, as otherwise
streaming would not even start.
Having a coordinator outside of replica for the partition/token you're
querying is a bit more complex, as it involves the knowledge about the
joined node that's distributed over gossip.

There are two properties that can improve the situation with range
movements: cassandra.consistent.rangemovement
and cassandra.consistent.simultaneousmoves.allow. First one disallows ring
changes in case there's any node in replica is offline. In addition to
that, it makes sure there are no moves within the ring. In that case, if
you're connected to coordinator that's a part of replica, data has to be
placed correctly. The data will be moved and any inconsistencies will be
eventually fixed with a repair (answering your question, there will be no
data lost during this process).

(I tried to provide information according to my best knowledge, although if
anyone sees something wrong, please indicate accordingly)

[1] https://dzone.com/articles/introduction-apache-cassandra

On Thu, May 19, 2016 at 5:58 AM Renjie Liu  wrote:

> BTW, is there any article explaining the process? I think this will help us
> understand it better.
>
> On Thu, May 19, 2016 at 11:28 AM Renjie Liu 
> wrote:
>
> > Thanks, I'll read the code.
> >
> > On Thu, May 19, 2016 at 11:02 AM Jeff Jirsa 
> > wrote:
> >
> >>
> >>
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java#L731-L754
> >>
> >>
> >> And
> >>
> >>
> >>
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java#L60-L88
> >>
> >>
> >>
> >> Cassandra keeps a map of joining and leaving nodes, and does extra
> writes
> >> to the appropriate nodes for mutations created after the streaming is
> >> calculated.
> >>
> >>
> >>
> >> On 5/18/16, 7:33 PM, "Renjie Liu"  wrote:
> >>
> >> >Hi, cassandra devs:
> >> >I'm learning cassandra and I can understand most of the techniques
> used.
> >> >But I can't understand how cassandra ensures consistency when
> >> >adding/removing a node? It seems that when a node joins the dht ring,
> >> some
> >> >node need to transferring data to the new node using streaming. But the
> >> >data may still get updated while transferring, so the new node can
> never
> >> >catch up with it. How cassandra handles this? Will cassandra lose data
> >> >during this process?
> >> >--
> >> >Liu, Renjie
> >> >Software Engineer, MVAD
> >
> > --
> > Liu, Renjie
> > Software Engineer, MVAD
> >
> --
> Liu, Renjie
> Software Engineer, MVAD
>
-- 
Alex Petrov


Re: How cassandra ensures consistency when adding or removing a node?

2016-05-19 Thread Renjie Liu
Thanks, Alex.

On Thu, May 19, 2016 at 3:44 PM Oleksandr Petrov 
wrote:

> I think that this article [1] covers most of the concepts (see key
> concepts) quite well.
> I am not aware of any article that explains the whole process, though.
>
> Briefly, there are several processes/concepts that are somewhat related to
> that subject: token ownership, replica, coordinator and gossip.
> Ensuring consistency in small cluster (amount of replica <= amount of
> nodes) is more or less straightforward. In this case, when node bootstraps,
> it notifies all the replicas, information about that node gets added to
> `pending nodes`, all nodes know about the bootstrapping node, as otherwise
> streaming would not even start.
> Having a coordinator outside of replica for the partition/token you're
> querying is a bit more complex, as it involves the knowledge about the
> joined node that's distributed over gossip.
>
> There are two properties that can improve the situation with range
> movements: cassandra.consistent.rangemovement
> and cassandra.consistent.simultaneousmoves.allow. First one disallows ring
> changes in case there's any node in replica is offline. In addition to
> that, it makes sure there are no moves within the ring. In that case, if
> you're connected to coordinator that's a part of replica, data has to be
> placed correctly. The data will be moved and any inconsistencies will be
> eventually fixed with a repair (answering your question, there will be no
> data lost during this process).
>
> (I tried to provide information according to my best knowledge, although if
> anyone sees something wrong, please indicate accordingly)
>
> [1] https://dzone.com/articles/introduction-apache-cassandra
>
> On Thu, May 19, 2016 at 5:58 AM Renjie Liu 
> wrote:
>
> > BTW, is there any article explaining the process? I think this will help
> us
> > understand it better.
> >
> > On Thu, May 19, 2016 at 11:28 AM Renjie Liu 
> > wrote:
> >
> > > Thanks, I'll read the code.
> > >
> > > On Thu, May 19, 2016 at 11:02 AM Jeff Jirsa <
> jeff.ji...@crowdstrike.com>
> > > wrote:
> > >
> > >>
> > >>
> >
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java#L731-L754
> > >>
> > >>
> > >> And
> > >>
> > >>
> > >>
> >
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java#L60-L88
> > >>
> > >>
> > >>
> > >> Cassandra keeps a map of joining and leaving nodes, and does extra
> > writes
> > >> to the appropriate nodes for mutations created after the streaming is
> > >> calculated.
> > >>
> > >>
> > >>
> > >> On 5/18/16, 7:33 PM, "Renjie Liu"  wrote:
> > >>
> > >> >Hi, cassandra devs:
> > >> >I'm learning cassandra and I can understand most of the techniques
> > used.
> > >> >But I can't understand how cassandra ensures consistency when
> > >> >adding/removing a node? It seems that when a node joins the dht ring,
> > >> some
> > >> >node need to transferring data to the new node using streaming. But
> the
> > >> >data may still get updated while transferring, so the new node can
> > never
> > >> >catch up with it. How cassandra handles this? Will cassandra lose
> data
> > >> >during this process?
> > >> >--
> > >> >Liu, Renjie
> > >> >Software Engineer, MVAD
> > >
> > > --
> > > Liu, Renjie
> > > Software Engineer, MVAD
> > >
> > --
> > Liu, Renjie
> > Software Engineer, MVAD
> >
> --
> Alex Petrov
>
-- 
Liu, Renjie
Software Engineer, MVAD


Re: Error running 'ant test'

2016-05-19 Thread Mahdi Mohammadi
I ran your command and test is successful but still there are tests which
are failing and I am confused.
My Java version is 1.8.0_74 and OS is 64 bit Debian (Vagrant box).

When I run: *ant clean && ant test -Dtest.name=CassandraIndexTest *(both on
trunk and cassandra-3.0), I get error:

   * [junit] INFO  09:40:24 Initializing
cql_test_keyspace.table_24.table_24_c_idx*
*[junit] INFO  09:40:24 Drop Keyspace 'cql_test_keyspace_alt'*
*[junit] -  ---*
*[junit] Testcase:
indexOnRegularColumn(org.apache.cassandra.index.internal.CassandraIndexTest):
FAILED*
*[junit] Got less rows than expected. Expected 1 but got 0*
*[junit] junit.framework.AssertionFailedError: Got less rows than
expected. Expected 1 but got 0*
*[junit] at
org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
*[junit] at
org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:660)*
*[junit] at
org.apache.cassandra.index.internal.CassandraIndexTest.indexOnRegularColumn(CassandraIndexTest.java:70)*
*[junit]*
*[junit]*
*[junit] Testcase:
indexOnNonFrozenListWithReplaceOperation(org.apache.cassandra.index.internal.CassandraIndexTest):
FAILED*
*[junit] Got less rows than expected. Expected 1 but got 0*
*[junit] junit.framework.AssertionFailedError: Got less rows than
expected. Expected 1 but got 0*
*[junit] at
org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
*[junit] at
org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:660)*
*[junit] at
org.apache.cassandra.index.internal.CassandraIndexTest.indexOnNonFrozenListWithReplaceOperation(CassandraIndexTest.java:148)*
*[junit]*
*[junit]*
*[junit] Testcase:
indexOnNonFrozenMapValuesWithReplaceOperation(org.apache.cassandra.index.internal.CassandraIndexTest):
   FAILED*
*[junit] Got less rows than expected. Expected 1 but got 0*
*[junit] junit.framework.AssertionFailedError: Got less rows than
expected. Expected 1 but got 0*
*[junit] at
org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
*[junit] at
org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:627)*
*[junit] at
org.apache.cassandra.index.internal.CassandraIndexTest.indexOnNonFrozenMapValuesWithReplaceOperation(CassandraIndexTest.java:212)*
*[junit]*
*[junit]*
*[junit] Test org.apache.cassandra.index.internal.CassandraIndexTest
FAILED*




Best Regards

On Thu, May 19, 2016 at 3:21 PM, Oleksandr Petrov <
oleksandr.pet...@gmail.com> wrote:

> I just tried it locally, `ant clean && ant test
> -Dtest.name=TopKSamplerTest` works just fine (tried the other test, too).
> What's your JDK version? I can't see anything obvious that is wrong. If the
> branch is up-to-date, it usually has to build.
>
>
> On Thu, May 19, 2016 at 5:12 AM Mahdi Mohammadi  wrote:
>
> > I am trying to run `ant test` on cassandra-3.0 branch but get some
> errors:
> >
> > *[junit] Testcase:
> >
> >
> testSamplerSingleInsertionsEqualMulti(org.apache.cassandra.utils.TopKSamplerTest):
> >FAILED*
> > *[junit] expected:<{item2=2, item1=1, item8=8, item7=7, item9=9,
> > item4=4, item10=10, item3=3, item6=6, item5=5}> but was:<{item2=2,
> item1=1,
> > item8=8, item7=7, item9=9, item4=4, item3=3, item6=6,*
> > *item5=5}>*
> > *[junit] junit.framework.AssertionFailedError: expected:<{item2=2,
> > item1=1, item8=8, item7=7, item9=9, item4=4, item10=10, item3=3, item6=6,
> > item5=5}> but was:<{item2=2, item1=1, item8=8, item7=7,*
> > *item9=9, item4=4, item3=3, item6=6, item5=5}>*
> > *[junit] at
> >
> >
> org.apache.cassandra.utils.TopKSamplerTest.testSamplerSingleInsertionsEqualMulti(TopKSamplerTest.java:39)*
> > *[junit]*
> >
> > Or this one:
> >
> > *[junit] Testcase:
> > executeTriggerOnThriftInsert(org.apache.cassandra.triggers.TriggersTest):
> > Caused an ERROR*
> > *[junit] Trigger trigger_1 already exists*
> > *[junit] org.apache.cassandra.exceptions.InvalidRequestException:
> > Trigger trigger_1 already exists*
> > *[junit] at
> >
> >
> org.apache.cassandra.cql3.statements.CreateTriggerStatement.announceMigration(CreateTriggerStatement.java:85)*
> > *[junit] at
> >
> >
> org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:93)*
> > *[junit] at
> >
> >
> org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:206)*
> > *[junit] at
> >
> org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:237)*
> > *[junit] at
> >
> org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:252)*
> > *[junit] at
> >
> org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:247)*
> > *[junit] at
> > org.apache.cassandra.triggers.TriggersTest.setup(Trigge

Re: Error running 'ant test'

2016-05-19 Thread Sam Tunnicliffe
CassandraIndexTest is intermittently failing on trunk & 3.0 at the moment:

http://cassci.datastax.com/view/trunk/job/trunk_utest/1378/testReport/
http://cassci.datastax.com/view/cassandra-3.0/job/cassandra-3.0_utest/747/testReport/

On Thu, May 19, 2016 at 3:24 PM, Oleksandr Petrov <
oleksandr.pet...@gmail.com> wrote:

> It passes for me, and seems to work on the CI.
> Rule of thumb for me personally is:
>   * make sure that everything cleaned up (no c* instances running, no tests
> running at same time)
>   * make sure the latest version is pulled
>   * in case something failed, try running more than once
>
> If it constantly fails, fire up the issue.
> If it failed just that one time, forget about it for now, it'll pop up
> again, so you'll think of it then.
> If it fails every other time, fire up the issue and explain that it doesn't
> fail all the time.
>
>
> On Thu, May 19, 2016 at 11:43 AM Mahdi Mohammadi  wrote:
>
> > I ran your command and test is successful but still there are tests which
> > are failing and I am confused.
> > My Java version is 1.8.0_74 and OS is 64 bit Debian (Vagrant box).
> >
> > When I run: *ant clean && ant test -Dtest.name=CassandraIndexTest *(both
> on
> > trunk and cassandra-3.0), I get error:
> >
> >* [junit] INFO  09:40:24 Initializing
> > cql_test_keyspace.table_24.table_24_c_idx*
> > *[junit] INFO  09:40:24 Drop Keyspace 'cql_test_keyspace_alt'*
> > *[junit] -  ---*
> > *[junit] Testcase:
> >
> >
> indexOnRegularColumn(org.apache.cassandra.index.internal.CassandraIndexTest):
> > FAILED*
> > *[junit] Got less rows than expected. Expected 1 but got 0*
> > *[junit] junit.framework.AssertionFailedError: Got less rows than
> > expected. Expected 1 but got 0*
> > *[junit] at
> > org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:660)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnRegularColumn(CassandraIndexTest.java:70)*
> > *[junit]*
> > *[junit]*
> > *[junit] Testcase:
> >
> >
> indexOnNonFrozenListWithReplaceOperation(org.apache.cassandra.index.internal.CassandraIndexTest):
> > FAILED*
> > *[junit] Got less rows than expected. Expected 1 but got 0*
> > *[junit] junit.framework.AssertionFailedError: Got less rows than
> > expected. Expected 1 but got 0*
> > *[junit] at
> > org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:660)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnNonFrozenListWithReplaceOperation(CassandraIndexTest.java:148)*
> > *[junit]*
> > *[junit]*
> > *[junit] Testcase:
> >
> >
> indexOnNonFrozenMapValuesWithReplaceOperation(org.apache.cassandra.index.internal.CassandraIndexTest):
> >FAILED*
> > *[junit] Got less rows than expected. Expected 1 but got 0*
> > *[junit] junit.framework.AssertionFailedError: Got less rows than
> > expected. Expected 1 but got 0*
> > *[junit] at
> > org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:627)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnNonFrozenMapValuesWithReplaceOperation(CassandraIndexTest.java:212)*
> > *[junit]*
> > *[junit]*
> > *[junit] Test org.apache.cassandra.index.internal.CassandraIndexTest
> > FAILED*
> >
> >
> >
> >
> > Best Regards
> >
> > On Thu, May 19, 2016 at 3:21 PM, Oleksandr Petrov <
> > oleksandr.pet...@gmail.com> wrote:
> >
> > > I just tried it locally, `ant clean && ant test
> > > -Dtest.name=TopKSamplerTest` works just fine (tried the other test,
> too).
> > > What's your JDK version? I can't see anything obvious that is wrong. If
> > the
> > > branch is up-to-date, it usually has to build.
> > >
> > >
> > > On Thu, May 19, 2016 at 5:12 AM Mahdi Mohammadi 
> > wrote:
> > >
> > > > I am trying to run `ant test` on cassandra-3.0 branch but get some
> > > errors:
> > > >
> > > > *[junit] Testcase:
> > > >
> > > >
> > >
> >
> testSamplerSingleInsertionsEqualMulti(org.apache.cassandra.utils.TopKSamplerTest):
> > > >FAILED*
> > > > *[junit] expected:<{item2=2, item1=1, item8=8, item7=7, item9=9,
> > > > item4=4, item10=10, item3=3, item6=6, item5=5}> but was:<{item2=2,
> > > item1=1,
> > > > item8=8, item7=7, item9=9, item4=4, item3=3, item6=6,*
> > > > *item5=5}>*
> > > > *[junit] junit.framework.AssertionFailedError:
> expected:<{item2=2,
> > > > item1=1, item8=8, item7=7, item9=9, item4=4, item10=10, item3=3,
> > item6=6,
> > > > item5=5}> but was:<{it

Re: Error running 'ant test'

2016-05-19 Thread Jonathan Ellis
Also, sometimes fragile tests are sensitive to the order in which they are
run.  If it passes on CI but not locally that may be what's going on.  You
can try running just the failed class (easy in ant) or test (hard in ant,
easy in intellij/eclipse) in isolation and see if that makes a difference.

On Thu, May 19, 2016 at 9:24 AM, Oleksandr Petrov <
oleksandr.pet...@gmail.com> wrote:

> It passes for me, and seems to work on the CI.
> Rule of thumb for me personally is:
>   * make sure that everything cleaned up (no c* instances running, no tests
> running at same time)
>   * make sure the latest version is pulled
>   * in case something failed, try running more than once
>
> If it constantly fails, fire up the issue.
> If it failed just that one time, forget about it for now, it'll pop up
> again, so you'll think of it then.
> If it fails every other time, fire up the issue and explain that it doesn't
> fail all the time.
>
>
> On Thu, May 19, 2016 at 11:43 AM Mahdi Mohammadi  wrote:
>
> > I ran your command and test is successful but still there are tests which
> > are failing and I am confused.
> > My Java version is 1.8.0_74 and OS is 64 bit Debian (Vagrant box).
> >
> > When I run: *ant clean && ant test -Dtest.name=CassandraIndexTest *(both
> on
> > trunk and cassandra-3.0), I get error:
> >
> >* [junit] INFO  09:40:24 Initializing
> > cql_test_keyspace.table_24.table_24_c_idx*
> > *[junit] INFO  09:40:24 Drop Keyspace 'cql_test_keyspace_alt'*
> > *[junit] -  ---*
> > *[junit] Testcase:
> >
> >
> indexOnRegularColumn(org.apache.cassandra.index.internal.CassandraIndexTest):
> > FAILED*
> > *[junit] Got less rows than expected. Expected 1 but got 0*
> > *[junit] junit.framework.AssertionFailedError: Got less rows than
> > expected. Expected 1 but got 0*
> > *[junit] at
> > org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:660)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnRegularColumn(CassandraIndexTest.java:70)*
> > *[junit]*
> > *[junit]*
> > *[junit] Testcase:
> >
> >
> indexOnNonFrozenListWithReplaceOperation(org.apache.cassandra.index.internal.CassandraIndexTest):
> > FAILED*
> > *[junit] Got less rows than expected. Expected 1 but got 0*
> > *[junit] junit.framework.AssertionFailedError: Got less rows than
> > expected. Expected 1 but got 0*
> > *[junit] at
> > org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:660)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnNonFrozenListWithReplaceOperation(CassandraIndexTest.java:148)*
> > *[junit]*
> > *[junit]*
> > *[junit] Testcase:
> >
> >
> indexOnNonFrozenMapValuesWithReplaceOperation(org.apache.cassandra.index.internal.CassandraIndexTest):
> >FAILED*
> > *[junit] Got less rows than expected. Expected 1 but got 0*
> > *[junit] junit.framework.AssertionFailedError: Got less rows than
> > expected. Expected 1 but got 0*
> > *[junit] at
> > org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:627)*
> > *[junit] at
> >
> >
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnNonFrozenMapValuesWithReplaceOperation(CassandraIndexTest.java:212)*
> > *[junit]*
> > *[junit]*
> > *[junit] Test org.apache.cassandra.index.internal.CassandraIndexTest
> > FAILED*
> >
> >
> >
> >
> > Best Regards
> >
> > On Thu, May 19, 2016 at 3:21 PM, Oleksandr Petrov <
> > oleksandr.pet...@gmail.com> wrote:
> >
> > > I just tried it locally, `ant clean && ant test
> > > -Dtest.name=TopKSamplerTest` works just fine (tried the other test,
> too).
> > > What's your JDK version? I can't see anything obvious that is wrong. If
> > the
> > > branch is up-to-date, it usually has to build.
> > >
> > >
> > > On Thu, May 19, 2016 at 5:12 AM Mahdi Mohammadi 
> > wrote:
> > >
> > > > I am trying to run `ant test` on cassandra-3.0 branch but get some
> > > errors:
> > > >
> > > > *[junit] Testcase:
> > > >
> > > >
> > >
> >
> testSamplerSingleInsertionsEqualMulti(org.apache.cassandra.utils.TopKSamplerTest):
> > > >FAILED*
> > > > *[junit] expected:<{item2=2, item1=1, item8=8, item7=7, item9=9,
> > > > item4=4, item10=10, item3=3, item6=6, item5=5}> but was:<{item2=2,
> > > item1=1,
> > > > item8=8, item7=7, item9=9, item4=4, item3=3, item6=6,*
> > > > *item5=5}>*
> > > > *[junit] junit.framework.AssertionFailedError:
> expected:<{item2=2,
> > > > item1=1, item8=8, item7=7, item9=9, item4=

Re: Error running 'ant test'

2016-05-19 Thread Oleksandr Petrov
It passes for me, and seems to work on the CI.
Rule of thumb for me personally is:
  * make sure that everything cleaned up (no c* instances running, no tests
running at same time)
  * make sure the latest version is pulled
  * in case something failed, try running more than once

If it constantly fails, fire up the issue.
If it failed just that one time, forget about it for now, it'll pop up
again, so you'll think of it then.
If it fails every other time, fire up the issue and explain that it doesn't
fail all the time.


On Thu, May 19, 2016 at 11:43 AM Mahdi Mohammadi  wrote:

> I ran your command and test is successful but still there are tests which
> are failing and I am confused.
> My Java version is 1.8.0_74 and OS is 64 bit Debian (Vagrant box).
>
> When I run: *ant clean && ant test -Dtest.name=CassandraIndexTest *(both on
> trunk and cassandra-3.0), I get error:
>
>* [junit] INFO  09:40:24 Initializing
> cql_test_keyspace.table_24.table_24_c_idx*
> *[junit] INFO  09:40:24 Drop Keyspace 'cql_test_keyspace_alt'*
> *[junit] -  ---*
> *[junit] Testcase:
>
> indexOnRegularColumn(org.apache.cassandra.index.internal.CassandraIndexTest):
> FAILED*
> *[junit] Got less rows than expected. Expected 1 but got 0*
> *[junit] junit.framework.AssertionFailedError: Got less rows than
> expected. Expected 1 but got 0*
> *[junit] at
> org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> *[junit] at
>
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:660)*
> *[junit] at
>
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnRegularColumn(CassandraIndexTest.java:70)*
> *[junit]*
> *[junit]*
> *[junit] Testcase:
>
> indexOnNonFrozenListWithReplaceOperation(org.apache.cassandra.index.internal.CassandraIndexTest):
> FAILED*
> *[junit] Got less rows than expected. Expected 1 but got 0*
> *[junit] junit.framework.AssertionFailedError: Got less rows than
> expected. Expected 1 but got 0*
> *[junit] at
> org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> *[junit] at
>
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:660)*
> *[junit] at
>
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnNonFrozenListWithReplaceOperation(CassandraIndexTest.java:148)*
> *[junit]*
> *[junit]*
> *[junit] Testcase:
>
> indexOnNonFrozenMapValuesWithReplaceOperation(org.apache.cassandra.index.internal.CassandraIndexTest):
>FAILED*
> *[junit] Got less rows than expected. Expected 1 but got 0*
> *[junit] junit.framework.AssertionFailedError: Got less rows than
> expected. Expected 1 but got 0*
> *[junit] at
> org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:818)*
> *[junit] at
>
> org.apache.cassandra.index.internal.CassandraIndexTest$TestScript.run(CassandraIndexTest.java:627)*
> *[junit] at
>
> org.apache.cassandra.index.internal.CassandraIndexTest.indexOnNonFrozenMapValuesWithReplaceOperation(CassandraIndexTest.java:212)*
> *[junit]*
> *[junit]*
> *[junit] Test org.apache.cassandra.index.internal.CassandraIndexTest
> FAILED*
>
>
>
>
> Best Regards
>
> On Thu, May 19, 2016 at 3:21 PM, Oleksandr Petrov <
> oleksandr.pet...@gmail.com> wrote:
>
> > I just tried it locally, `ant clean && ant test
> > -Dtest.name=TopKSamplerTest` works just fine (tried the other test, too).
> > What's your JDK version? I can't see anything obvious that is wrong. If
> the
> > branch is up-to-date, it usually has to build.
> >
> >
> > On Thu, May 19, 2016 at 5:12 AM Mahdi Mohammadi 
> wrote:
> >
> > > I am trying to run `ant test` on cassandra-3.0 branch but get some
> > errors:
> > >
> > > *[junit] Testcase:
> > >
> > >
> >
> testSamplerSingleInsertionsEqualMulti(org.apache.cassandra.utils.TopKSamplerTest):
> > >FAILED*
> > > *[junit] expected:<{item2=2, item1=1, item8=8, item7=7, item9=9,
> > > item4=4, item10=10, item3=3, item6=6, item5=5}> but was:<{item2=2,
> > item1=1,
> > > item8=8, item7=7, item9=9, item4=4, item3=3, item6=6,*
> > > *item5=5}>*
> > > *[junit] junit.framework.AssertionFailedError: expected:<{item2=2,
> > > item1=1, item8=8, item7=7, item9=9, item4=4, item10=10, item3=3,
> item6=6,
> > > item5=5}> but was:<{item2=2, item1=1, item8=8, item7=7,*
> > > *item9=9, item4=4, item3=3, item6=6, item5=5}>*
> > > *[junit] at
> > >
> > >
> >
> org.apache.cassandra.utils.TopKSamplerTest.testSamplerSingleInsertionsEqualMulti(TopKSamplerTest.java:39)*
> > > *[junit]*
> > >
> > > Or this one:
> > >
> > > *[junit] Testcase:
> > >
> executeTriggerOnThriftInsert(org.apache.cassandra.triggers.TriggersTest):
> > > Caused an ERROR*
> > > *[junit] Trigger trigger_1 already exists*
> > > *[junit] org.apache.cassandra.exceptions.InvalidRequestException:
> > > Trigger trigger_1 

How to debug a unit test?

2016-05-19 Thread Mahdi Mohammadi
Hi,

I can run a single unit test using `ant test -Dtest.name=TraceCqlTest`.
How can I debug the test using gdb (in the terminal)?

Best Regards


Re: How to debug a unit test?

2016-05-19 Thread Oleksandr Petrov
I'm not entirely sure how to debug in terminal. But you can set break
points and debug in eclipse and IntelliJ without a problem.

I strongly recommend reading the contributing guide:
https://wiki.apache.org/cassandra/HowToContribute

On Fri, 20 May 2016 at 03:18, Mahdi Mohammadi  wrote:

> Hi,
>
> I can run a single unit test using `ant test -Dtest.name=TraceCqlTest`.
> How can I debug the test using gdb (in the terminal)?
>
> Best Regards
>
-- 
Alex Petrov