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

Benjamin Lerer commented on CASSANDRA-17653:
--------------------------------------------

{quote}Geeting expire() inside a sync block should suffice, do you agree?{quote}
Yes

{quote}Unless an expiration happens setting it to 0, where it will not meet the 
if and return the memoized value. Leaving everything ready for the next get() 
to refresh the memoized value.{quote}

What I mean is that:
{code}
nanos = now + this.durationNanos;
this.expirationNanos = nanos == 0L ? 1L : nanos;
{code}
can be simplified to:
{code}
this.expirationNanos = now + this.durationNanos;
{code} 

 {quote}I prefer to try my luck on getting a lucky test run that logs what I 
need. Sounds reasonable?{quote}
Luck does not tend to be something really reliable in my opinion. 
The alternative for me is to modify the method to allow us to capture the 
information we need. We could return a Pair<Boolean, CassandraVersion> for 
example


> Fix flaky test - 
> org.apache.cassandra.cql3.validation.operations.InsertUpdateIfConditionTest.testConditionalUpdate[0:
>  clusterMinVersion=3.0]
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17653
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17653
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/dtest/java
>            Reporter: Brandon Williams
>            Assignee: Berenguer Blasi
>            Priority: Normal
>             Fix For: 4.1-beta, 4.1.x
>
>
> {code}
> junit.framework.AssertionFailedError
>       at 
> org.apache.cassandra.cql3.validation.operations.InsertUpdateIfConditionTest.lambda$data$0(InsertUpdateIfConditionTest.java:64)
>       at 
> org.apache.cassandra.cql3.validation.operations.InsertUpdateIfConditionTest.beforeSetup(InsertUpdateIfConditionTest.java:90)
>       at 
> org.apache.cassandra.cql3.validation.operations.InsertUpdateIfConditionTest.before(InsertUpdateIfConditionTest.java:84)
>       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}
> https://ci-cassandra.apache.org/job/Cassandra-4.1/34/testReport/org.apache.cassandra.cql3.validation.operations/InsertUpdateIfConditionTest/testConditionalUpdate_0__clusterMinVersion_3_0__3/



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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

Reply via email to