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

Alex Lourie commented on CASSANDRA-14054:
-----------------------------------------

[~mkjellman]

I've run the test on CircleCI with your configuration another 20 times and all 
pass successfully. So it might indeed be some kind of a racing condition in 
your environment.

The following is the code tested:

{code:java}
 updateView("UPDATE %s USING TIMESTAMP 1 SET c = ?, val = ? WHERE k = ?", 0, 0, 
0);
 updateView("UPDATE %s USING TIMESTAMP 3 SET c = ? WHERE k = ?", 1, 0);
 updateView("UPDATE %s USING TIMESTAMP 2 SET val = ? WHERE k = ?", 1, 0);
 updateView("UPDATE %s USING TIMESTAMP 4 SET c = ? WHERE k = ?", 2, 0);
 updateView("UPDATE %s USING TIMESTAMP 3 SET val = ? WHERE k = ?", 2, 0);

 assertRows(execute("SELECT c, k, val FROM mv_rctstest"), row(2, 0, 2));
 assertRows(execute("SELECT c, k, val FROM mv_rctstest limit 1"), row(2, 0, 2));
{code}

This code works on the same data, as it updates the same row. It is possible 
that due to unclear timing peculiarities, the assert runs before the update had 
propagated to all the replicas; or that it runs even before the update has 
applied to the row on any replica. Even though that would be extremeley strange 
in the environment where the tests are run.

We could do something like you suggesting, adding  
"getCurrentColumnFamilyStore().forceBlockingFlush();" before the asserts.

It seems that I can't reproduce this in my environment. Is there anything 
specific that your environment may have that mine doesn't?


> testRegularColumnTimestampUpdates - org.apache.cassandra.cql3.ViewTest is 
> flaky: expected <2> but got <1>
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-14054
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14054
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Testing
>            Reporter: Michael Kjellman
>            Assignee: Alex Lourie
>
> testRegularColumnTimestampUpdates - org.apache.cassandra.cql3.ViewTest is 
> flaky: expected <2> but got <1>
> Fails about 25% of the time. It is currently our only flaky unit test on 
> trunk so it would be great to get this one fixed up so we can be confident in 
> unit test failures going forward.
> junit.framework.AssertionFailedError: Invalid value for row 0 column 0 (c of 
> type int), expected <2> but got <1>
>       at org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:973)
>       at 
> org.apache.cassandra.cql3.ViewTest.testRegularColumnTimestampUpdates(ViewTest.java:380)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to