Ignore:
Timestamp:
01/23/12 06:00:05 (4 months ago)
Author:
PaulHarvey
Message:

Item11431: Clean UnitTests of Foswiki->new/finish

Committing what was 96 commits rebased on top of Foswikirev:13781. You
can view this full commit history at
 https://github.com/csirac2/UnitTestContrib/commits/Item11431-rebased

Tackling memory leaks, this effort seems to have saved 300MB and 10
minutes from the cost of running a full FoswikiSuite.

The recipe was:

  • Find and remove all Foswiki->new/finish calls with $this->createNewFoswikiSession()
  • Generally removed $fatwilly variables and replaced with $this->{session}, to avoid references to ->finish()'d Foswiki singleton/session objects
  • Addressed perlcriticisms in touched files
  • Convert Foswiki::Meta->new/load to Foswiki::Func::readTopic, for the sake of store2 re-integration
  • Call $topicObject->finish() where/whenever we can

Some of the tests in the default plugins need a little work, and
there's some uncommitted stuff against core lib/Foswiki.pm to help
assert SINGLE_SINGLETONS from Foswiki::new/::finish subs, we'll get
to that later...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UnitTestContrib/test/unit/AddressTests.pm

    r13376 r13791  
    266266    $query->path_info("/$this->{test_web}/$this->{test_topic}"); 
    267267 
    268     $this->{session}->finish() if $this->{session}; 
    269     $this->{session} = Foswiki->new( $Foswiki::cfg{AdminUserLogin}, $query ); 
     268    $this->createNewFoswikiSession( $Foswiki::cfg{AdminUserLogin}, $query ); 
    270269 
    271270    ( $this->{test_topicObject} ) = 
Note: See TracChangeset for help on using the changeset viewer.