Derby
  1. Derby
  2. DERBY-4997

SysinfoTest version output filtering is fragile with new java versions

    Details

    • Issue & fix info:
      Newcomer

      Description

      Some newer java version output may have lines lines that are not filtered out by the existing SysinfoTest.
      Myrna suggests checking for and filtering out the exact properties we expect to see to make a better test and make it less fragile.

      1. derby-4997_notforcommit.txt
        0.8 kB
        Kathey Marsden
      2. derby-4997_diff.txt
        8 kB
        Kathey Marsden

        Activity

        Hide
        Kathey Marsden added a comment -

        This was my first shot at fixing this issue for an IBM jvm, but I want to make it more generic as Myrna suggested. Attaching mostly to try out attach in New Jira.

        Show
        Kathey Marsden added a comment - This was my first shot at fixing this issue for an IBM jvm, but I want to make it more generic as Myrna suggested. Attaching mostly to try out attach in New Jira.
        Hide
        Kathey Marsden added a comment -

        I have been looking at this test derbynet.SysinfoTest and it seems to me its focus is to make sure the network server properties derby.drda.* print.
        It does this by replacing everything else with empty strings in the sed() method. I am thinking that we should just have the test check for the things it is looking for and not fail for additional lines as it often does as new things are added or if jvm's have multiline version output.

        One thing to note is that while the output checks for this test focus on network server, this is the only test that we actually have for Sysinfo,
        So it might be nice to expand it at some point to check the other things that sysinfo outputs. As another aside I am seeing permission errors in the sysinfo output for java.home, user.name and user.home. I thought this was addressed at one point, but will file an issue if needed.

        Show
        Kathey Marsden added a comment - I have been looking at this test derbynet.SysinfoTest and it seems to me its focus is to make sure the network server properties derby.drda.* print. It does this by replacing everything else with empty strings in the sed() method. I am thinking that we should just have the test check for the things it is looking for and not fail for additional lines as it often does as new things are added or if jvm's have multiline version output. One thing to note is that while the output checks for this test focus on network server, this is the only test that we actually have for Sysinfo, So it might be nice to expand it at some point to check the other things that sysinfo outputs. As another aside I am seeing permission errors in the sysinfo output for java.home, user.name and user.home. I thought this was addressed at one point, but will file an issue if needed.
        Hide
        Kathey Marsden added a comment -

        Here is the patch I would like to commit for this issue. The sed method has been removed and now the tests just checks for the strings that it needs to check in the output without failing if the number of lines change.

        Show
        Kathey Marsden added a comment - Here is the patch I would like to commit for this issue. The sed method has been removed and now the tests just checks for the strings that it needs to check in the output without failing if the number of lines change.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development