[ https://issues.apache.org/jira/browse/CASSANDRA-18453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17725228#comment-17725228 ]
Stefan Miklosovic commented on CASSANDRA-18453: ----------------------------------------------- j11 precommit https://app.circleci.com/pipelines/github/instaclustr/cassandra/2277/workflows/6d0d282b-0a05-4852-b067-a4c12390051c j8 precommit https://app.circleci.com/pipelines/github/instaclustr/cassandra/2277/workflows/c0557226-1353-4705-9073-35758be14422 > 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 > > Time Spent: 1h 50m > Remaining Estimate: 0h > > 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: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org