Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/289360
Change subject: PHPSessionHandlerTest: don't sleep() to test PHP
......................................................................
PHPSessionHandlerTest: don't sleep() to test PHP
The test verifies that $_SESSION clears out when the session is
garbage-collected. The need to muck with several ini settings to get the test
to work at all is a good sign that the test is testing PHP, and not the system
under test. Since it's taking 9 seconds to do that, just remove it. I don't
think it adds value.
It'd be nice to add some test for PHPSessionHandler::gc(), but the
encapsulation here is so strict that you can't do it without a lot of
metaprogramming, and that's more involved than what I am trying to do.
Bug: T135576
Change-Id: I6e153ec8bfa5972ed45a0e6b7720832692b952fb
---
M tests/phpunit/includes/session/PHPSessionHandlerTest.php
1 file changed, 0 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/60/289360/1
diff --git a/tests/phpunit/includes/session/PHPSessionHandlerTest.php
b/tests/phpunit/includes/session/PHPSessionHandlerTest.php
index ce0f1b0..799a97b 100644
--- a/tests/phpunit/includes/session/PHPSessionHandlerTest.php
+++ b/tests/phpunit/includes/session/PHPSessionHandlerTest.php
@@ -173,14 +173,6 @@
$this->assertSame( $expect, $_SESSION );
}
- // Test expiry
- session_write_close();
- ini_set( 'session.gc_divisor', 1 );
- ini_set( 'session.gc_probability', 1 );
- sleep( 3 );
- session_start();
- $this->assertSame( [], $_SESSION );
-
// Re-fill the session, then test that session_destroy() works.
$_SESSION['AuthenticationSessionTest'] = $rand;
session_write_close();
--
To view, visit https://gerrit.wikimedia.org/r/289360
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e153ec8bfa5972ed45a0e6b7720832692b952fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits