Derby
  1. Derby
  2. DERBY-5816

store.ServicePropertiesFileTest fails on z/OS

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.8.3.3, 10.9.2.2
    • Component/s: Store, Test
    • Labels:
      None
    • Environment:
    • Bug behavior facts:
      Regression Test Failure

      Description

      store.ServicePropertiesFileTest fails on z/OS with two failures below. Looks like likely test encoding issue

      1) testSevicePropertiesFileWithBackup(org.apache.derbyTesting.functionTests.tests.store.ServicePropertiesFileTest)junit.
      framework.AssertionFailedError
      at org.apache.derbyTesting.functionTests.tests.store.ServicePropertiesFileTest.assertEOFToken(ServicePropertiesF
      ileTest.java:275)
      at org.apache.derbyTesting.functionTests.tests.store.ServicePropertiesFileTest.testSevicePropertiesFileWithBacku
      p(ServicePropertiesFileTest.java:178)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      2) testSevicePropertiesFileCorruptedWithBackup(org.apache.derbyTesting.functionTests.tests.store.ServicePropertiesFileTe
      st)junit.framework.ComparisonFailure: expected:<— last line, don't put anything after this line —> but was:<[

      {``` @ @ k@ }

      @ @ @ @ @ @```§]>
      at org.apache.derbyTesting.functionTests.tests.store.ServicePropertiesFileTest.removeEOFToken(ServicePropertiesF
      ileTest.java:301)
      at org.apache.derbyTesting.functionTests.tests.store.ServicePropertiesFileTest.testSevicePropertiesFileCorrupted
      WithBackup(ServicePropertiesFileTest.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)

      FAILURES!!!
      Tests run: 290, Failures: 2, Errors: 0

      1. DERBY-5816_diff.txt
        6 kB
        Kathey Marsden
      2. DERBY-5816_diff.txt
        6 kB
        Kathey Marsden

        Issue Links

          Activity

          Hide
          ASF subversion and git services added a comment -

          Commit 1504199 from Kathey Marsden in branch 'code/branches/10'
          [ https://svn.apache.org/r1504199 ]

          DERBY-5283 Crash / process termination during SYSCS_DISABLE_LOG_ARCHIVE_MODE can leave service.properties broken

          Merge from trunk also includes the fix for DERBY-5816 which was a test failure caused by the original change. The message files had to be manually merged.

          revisions merged were:
          DERBY-5283 1188109 1188828

          DERBY-5816 1350361 1353764

          Show
          ASF subversion and git services added a comment - Commit 1504199 from Kathey Marsden in branch 'code/branches/10' [ https://svn.apache.org/r1504199 ] DERBY-5283 Crash / process termination during SYSCS_DISABLE_LOG_ARCHIVE_MODE can leave service.properties broken Merge from trunk also includes the fix for DERBY-5816 which was a test failure caused by the original change. The message files had to be manually merged. revisions merged were: DERBY-5283 1188109 1188828 DERBY-5816 1350361 1353764
          Hide
          ASF subversion and git services added a comment -

          Commit 1504199 from Kathey Marsden in branch 'code/branches/10'
          [ https://svn.apache.org/r1504199 ]

          DERBY-5283 Crash / process termination during SYSCS_DISABLE_LOG_ARCHIVE_MODE can leave service.properties broken

          Merge from trunk also includes the fix for DERBY-5816 which was a test failure caused by the original change. The message files had to be manually merged.

          revisions merged were:
          DERBY-5283 1188109 1188828

          DERBY-5816 1350361 1353764

          Show
          ASF subversion and git services added a comment - Commit 1504199 from Kathey Marsden in branch 'code/branches/10' [ https://svn.apache.org/r1504199 ] DERBY-5283 Crash / process termination during SYSCS_DISABLE_LOG_ARCHIVE_MODE can leave service.properties broken Merge from trunk also includes the fix for DERBY-5816 which was a test failure caused by the original change. The message files had to be manually merged. revisions merged were: DERBY-5283 1188109 1188828 DERBY-5816 1350361 1353764
          Hide
          Kathey Marsden added a comment -

          This issue needs to be backported with DERBY-5283. Removing backport reject label

          Show
          Kathey Marsden added a comment - This issue needs to be backported with DERBY-5283 . Removing backport reject label
          Hide
          Kathey Marsden added a comment -

          This issue does not exist in 10.8, so backported only to 10.9

          Show
          Kathey Marsden added a comment - This issue does not exist in 10.8, so backported only to 10.9
          Hide
          Dag H. Wanvik added a comment -

          Thanks!

          + //Service Properties File is always encoded in US-ASCII
          + // because it is written with Properties.store
          + private static final String SPF_ENCODING = "ISO-8859-1";

          Guess the comment should say "ISO-8859-1", too.

          Show
          Dag H. Wanvik added a comment - Thanks! + //Service Properties File is always encoded in US-ASCII + // because it is written with Properties.store + private static final String SPF_ENCODING = "ISO-8859-1"; Guess the comment should say "ISO-8859-1", too.
          Hide
          Kathey Marsden added a comment -

          Thanks Kristian. Here is the updated patch. I will commit in a bit unless I hear other comments.

          Show
          Kathey Marsden added a comment - Thanks Kristian. Here is the updated patch. I will commit in a bit unless I hear other comments.
          Hide
          Kristian Waagan added a comment -

          I think you're right about this being a product issue as well as a test issue, but the consequences are small.
          In the normal case where there is just the service properties file and no backup file present, Derby won't even look at the marker line. The only time this can go wrong is if both the service properties file and the backup file are present and the backup file has been corrupted.

          Note that according to the Java API the encoding used in Properties.store(OutputStream,String) is ISO-8859-1, not US-ASCII ([1], [2]).

          [1] http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html
          [2] http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html

          Show
          Kristian Waagan added a comment - I think you're right about this being a product issue as well as a test issue, but the consequences are small. In the normal case where there is just the service properties file and no backup file present, Derby won't even look at the marker line. The only time this can go wrong is if both the service properties file and the backup file are present and the backup file has been corrupted. Note that according to the Java API the encoding used in Properties.store(OutputStream,String) is ISO-8859-1, not US-ASCII ( [1] , [2] ). [1] http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html [2] http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html
          Hide
          Kathey Marsden added a comment -

          ATtached is a patch for this issue. I think that there is a product issue as well as a test issue. The new marker at the the end of service.properties should have been written out in US-ASCII to match the encoding of the rest of the service.properties file that was written with Propoerties.store().

          Please review. I think/hope the issue with the wrong encoding for the end of file marker is not a regression from 10.8, but just means that the fix for DERBY-5283 won't work on z/os in 10.9.

          Note: In order to test encoding sensitive changes on Windows you can run with -Dfile.encoding="UTF-16"

          Show
          Kathey Marsden added a comment - ATtached is a patch for this issue. I think that there is a product issue as well as a test issue. The new marker at the the end of service.properties should have been written out in US-ASCII to match the encoding of the rest of the service.properties file that was written with Propoerties.store(). Please review. I think/hope the issue with the wrong encoding for the end of file marker is not a regression from 10.8, but just means that the fix for DERBY-5283 won't work on z/os in 10.9. Note: In order to test encoding sensitive changes on Windows you can run with -Dfile.encoding="UTF-16"

            People

            • Assignee:
              Kathey Marsden
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development