Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18453

Use WithProperties to ensure that system properties are handled

    XMLWordPrintableJSON

Details

    Description

      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:

              try
              {
                  COMMITLOG_IGNORE_REPLAY_ERRORS.setBoolean(true);
                  testRecoveryWithGarbageLog();
              }
              finally
              {
                  COMMITLOG_IGNORE_REPLAY_ERRORS.clearValue();
              }
      

      Can be replaced with:

              try (WithProperties = new WithProperties().with(COMMITLOG_IGNORE_REPLAY_ERRORS, "true"))
              {
                  testRecoveryWithGarbageLog();
              }
      

      Attachments

        Issue Links

          Activity

            People

              bernardo.botella Bernardo Botella Corbi
              mmuzaf Maxim Muzafarov
              Bernardo Botella Corbi
              Jacek Lewandowski, Maxim Muzafarov, Stefan Miklosovic
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m