Remove a test case from PHPSessionHandlerTest::testSessionHandling()
authorOri Livneh <ori@wikimedia.org>
Wed, 18 May 2016 06:14:00 +0000 (23:14 -0700)
committerMZMcBride <w@mzmcbride.com>
Wed, 1 Jun 2016 04:46:41 +0000 (04:46 +0000)
commit8a4f10931d2cf13b9a8166104447a3aaa86c8606
treea8abe04d03a3d3c491fac31a85a47db83bead543
parentf829125b49fdecf41ee737dee39a86fbbbabde2d
Remove a test case from PHPSessionHandlerTest::testSessionHandling()

The test sleeps for nine seconds (3 invocations, 3 seconds per
invocation) which is difficult to sit through.

The test code sets the value of two PHP parameters, session.gc_divisor
and session.gc_probability, to 1. This may be to ensure that PHP will
invoke the session handler's gc() method when the call is made to
session_start() below. But the call to PHPSessionHandler::gc() is
immaterial, for two reasons:

- PHPSessionHandler::gc() evicts items by calling the
  deleteObjectsExpiringBefore() on the BagOStuff instance it uses for
  storage. The only BagOStuff implementation that actually uses that
  method to evict items is SqlBagOStuff, which we're not using here,
  and which would be an odd choice of a storage backend for sessions.
- PHP calls SessionHandler::gc() _after_ opening the new (or resumed)
  session and loading its data, so even if deleteObjectsExpiringBefore()
  actually did anything, it would not influence the result of the test.

Bug: T135576
Change-Id: I6e153ec8bfa5972ed45a0e6b7720832692b952fb
tests/phpunit/includes/session/PHPSessionHandlerTest.php