Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-821

TestEngine sometimes creates testrepositories with double timestamps after r1567444

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.10
    • 2.10.1
    • None
    • linux openjdk 1.7.0_51

    Description

      r1567444 changed TestEngine.cleanTestProps so that it now concatenates System.currentTimeMillis to the property jspwiki.fileSystemProvider.pageDir.

      This is a good idea, because each test then has a unique name for its pageDir and so post-mortems of failing tests become easier.

      Unfortunately, this created an obscure problem because some of the methods and variables in this class are static, while others are instance, but they all play around with the caller's Properties, which might be static or instance, and also with its own static combinedProperties variable.

      This leads to several, but a minority, getting double timestamps, eg testrepository13923117464781392311746502.

      I discovered this behaviour when holding jspwiki-vers-custom.properties in a static variable and also creating a new TestEngine after changing one of the properties... my resulting testrepository had at least 12 concatenated timestamps - probably one for each test case, plus one more! Since changing my class to assign the properties to an instance variable, its testrepository only collects two timestamps.

      This weirdness does not prevent any of the tests running successfully because the directory name is used consistently throughout the suite. However, it is confusing when working on a problem that requires examination of the testrepository contents. This code should be fixed when someone finds both the time and enthusiasm!

      Attachments

        Activity

          People

            Unassigned Unassigned
            brianb2 Brian Burch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified