Derby
  1. Derby
  2. DERBY-4199

Write exceptions to file in the fail directory as they occur with JUnit tests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: 10.6.1.0
    • Component/s: Test
    • Labels:
      None
    • Issue & fix info:
      High Value Fix

      Description

      It would be very helpful to write exceptions to the fail directory as they oiccur with JUnit tests.
      If tests hang we can still get the failure information and sometimes it is just more efficient to be able to see failures as they occur. Kristian attached a patch to DERBY-2667 for this but it no longer applies to trunk (derby-2667-WriteExceptionsToFileAsTheyHappen.diff).

        Issue Links

          Activity

          Kathey Marsden created issue -
          Kathey Marsden made changes -
          Field Original Value New Value
          Link This issue is related to DERBY-2667 [ DERBY-2667 ]
          Kathey Marsden made changes -
          Derby Categories [High Value Fix]
          Kristian Waagan made changes -
          Assignee Kristian Waagan [ kristwaa ]
          Hide
          Kristian Waagan added a comment -

          I refreshed, and changed, the original patch.
          Patch 1a will log exceptions to a file called 'error-stacktrace.out' in the same directory as derby.log and the database are saved. If copying the log file or the database fail, that exception will also be logged to the file.
          To avoid overwriting potentially valuable information, the file is opened in append mode. The time and date are written as a header before the exception stack trace is written.

          I have tested the patch manually (by throwing an exception in a test, and also by removing the write privileges on the derby.log file), and will start the regression tests.
          Patch ready for review.

          Show
          Kristian Waagan added a comment - I refreshed, and changed, the original patch. Patch 1a will log exceptions to a file called 'error-stacktrace.out' in the same directory as derby.log and the database are saved. If copying the log file or the database fail, that exception will also be logged to the file. To avoid overwriting potentially valuable information, the file is opened in append mode. The time and date are written as a header before the exception stack trace is written. I have tested the patch manually (by throwing an exception in a test, and also by removing the write privileges on the derby.log file), and will start the regression tests. Patch ready for review.
          Kristian Waagan made changes -
          Kristian Waagan made changes -
          Derby Info [Patch Available]
          Hide
          Kristian Waagan added a comment -

          Committed patch 1a to trunk with revision 774729.
          It has only gone through manual testing, I'll verify it in one of the nightly tests.
          The patch can be merged with 10.5 cleanly, but merging it with 10.4 requires a separate patch or possibly backporting of an additional change.

          I do plan to backport to 10.5.

          Show
          Kristian Waagan added a comment - Committed patch 1a to trunk with revision 774729. It has only gone through manual testing, I'll verify it in one of the nightly tests. The patch can be merged with 10.5 cleanly, but merging it with 10.4 requires a separate patch or possibly backporting of an additional change. I do plan to backport to 10.5.
          Kristian Waagan made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Derby Info [Patch Available]
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Resolution Fixed [ 1 ]
          Hide
          Kristian Waagan added a comment -

          Backported to the 10.5 branch with revision 775907.

          I verified that the logging worked by looking at some (internal) archives from Ole's daily testing, where the exceptions logged to file in the fail-directory matched those reported by Ole's frameworks. I verified it for both failures and errors.

          Show
          Kristian Waagan added a comment - Backported to the 10.5 branch with revision 775907. I verified that the logging worked by looking at some (internal) archives from Ole's daily testing, where the exceptions logged to file in the fail-directory matched those reported by Ole's frameworks. I verified it for both failures and errors.
          Dag H. Wanvik made changes -
          Issue & fix info [High Value Fix]
          Kathey Marsden made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12462178 ] Default workflow, editable Closed status [ 12799918 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development