• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7521: Unit tests: loads of warnings in AccessControlTests.pm

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension UnitTests Low No Action Required   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


Running perl ../bin/TestRunner.pl AccessControlTests.pm gives one warning per test case like this:
[Sun Jun 22 12:46:52 2014] TestRunner.pl: readdir() attempted on invalid dirhandle $DIR at /media/haj/linuxdevel/twiki/trunk/core/lib/TWiki/Store/RcsFile.pm line 376.
[Sun Jun 22 12:46:52 2014] TestRunner.pl: closedir() attempted on invalid dirhandle $DIR at /media/haj/linuxdevel/twiki/trunk/core/lib/TWiki/Store/RcsFile.pm line 378.

Tests pass, though. But how can we be sure that they tested the right thing if invalid dirhandles are around?

This is my second try to get the unit tests running. The first was running the full suite which ended up in a desaster: perl used all the RAM, then all the swap, requiring a power off of the machine. The console had a lot of warnings, at least one of them apparently deadly. I'm afraid these need to be eliminated one by one.

I wonder... years ago I had commit rights for TWiki. Are they still active? I could give it a try...

-- TWiki:Main/HaraldJoerg - 2014-06-22

Ok, commit doesn't work, so here's the patch:

Index: TWikiFnTestCase.pm
--- TWikiFnTestCase.pm   (revision 27670)
+++ TWikiFnTestCase.pm   (working copy)
@@ -61,8 +61,8 @@
     $TWiki::Plugins::SESSION = $this->{twiki};
     @mails = ();
+    $this->{twiki}->{store}->createWeb( $this->{twiki}->{user}, $this->{users_web} );
     $this->{twiki}->{store}->createWeb( $this->{twiki}->{user}, $this->{test_web} );
-    $this->{twiki}->{store}->createWeb( $this->{twiki}->{user}, $this->{users_web} );
     $this->{test_user_forename} = 'Scum';
     $this->{test_user_surname} = 'Bag';
     $this->{test_user_wikiname} = $this->{test_user_forename}.$this->{test_user_surname};

Rationale: TWiki:Plugins.WatchlistPlugin is installed and activated per default. On creation of the test_web it tries to check whether someone has a watchlist for that. Hm. You can set a watch on a not-yet-existing web? Okaaay.... Anyway, to check for watchlists the plugin needs to read the users_web, which has not yet been created in the right place.

The patch simply reverts the order of web creation: users_web first, then test_web. This is a sensible order in any case.

-- TWiki:Main.HaraldJoerg - 2014-06-23

Committed under Item7535 - closing this one as a duplicate.

-- TWiki:Main.HaraldJoerg - 2014-07-18

Summary Unit tests: loads of warnings in AccessControlTests.pm
ReportedBy TWiki:Main.HaraldJoerg
Codebase ~twiki4
SVN Range TWiki-6.0.1-trunk, Sun, 15 Jun 2014, build 27651
AppliesTo Extension
Component UnitTests
Priority Low
CurrentState No Action Required


TargetRelease n/a

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r3 - 2014-07-18 - HaraldJoerg
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback