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

Bernardo Botella Corbi commented on CASSANDRA-18453:
----------------------------------------------------

Patch posted


||PR||Circle 8||Circle 11||
|[trunk|https://github.com/apache/cassandra/pull/2352]|[UTests|https://app.circleci.com/pipelines/github/bbotella/cassandra/76/workflows/cfd20f83-a258-479b-b033-99cd15f1961f/jobs/577]|[Utests|https://app.circleci.com/pipelines/github/bbotella/cassandra/76/workflows/5b7d88ea-42a5-40aa-9790-507fc6fc3576/jobs/576]|


> Use WithProperties to ensure that system properties are handled
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-18453
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18453
>             Project: Cassandra
>          Issue Type: Task
>          Components: CI
>            Reporter: Maxim Muzafarov
>            Assignee: Bernardo Botella Corbi
>            Priority: Normal
>              Labels: low-hanging-fruit
>             Fix For: 5.x
>
>
> The {{WithProperties}} is used to handle system properties to set and reset 
> values during the test run, instead of try-catch it uses the 
> try-with-resource approach which facilitates test development.
> We need to replace all the try-catch clauses that work with system properties 
> with {{WithProperties}} and try-with-resource for all the similar cases and 
> where it is technically possible.
> Example:
> {code:java}
>         try
>         {
>             COMMITLOG_IGNORE_REPLAY_ERRORS.setBoolean(true);
>             testRecoveryWithGarbageLog();
>         }
>         finally
>         {
>             COMMITLOG_IGNORE_REPLAY_ERRORS.clearValue();
>         }
> {code}
> Can be replaced with:
> {code:java}
>         try (WithProperties = new 
> WithProperties().with(COMMITLOG_IGNORE_REPLAY_ERRORS, "true"))
>         {
>             testRecoveryWithGarbageLog();
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to