Brian Burch created JSPWIKI-821:
-----------------------------------

             Summary: TestEngine sometimes creates testrepositories with double 
timestamps after r1567444
                 Key: JSPWIKI-821
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-821
             Project: JSPWiki
          Issue Type: Bug
    Affects Versions: 2.10
         Environment: linux openjdk 1.7.0_51
            Reporter: Brian Burch
            Priority: Minor


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!




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to