Last modified: 2014-10-19 17:47:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T69656, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67656 - Something in unit tests is doing something funky with the session
Something in unit tests is doing something funky with the session
Status: NEW
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-08 04:33 UTC by Chad H.
Modified: 2014-10-19 17:47 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Chad H. 2014-07-08 04:33:41 UTC
I've been getting this for quite some time. First on OSX then on Vagrant. I've been hitting my head against the wall. Some test (not all) triggers a session reset. Nothing seems to fail weirdly in the tests, but once you're done the output is appended with:

---

PHP Warning:  Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /vagrant/mediawiki/tests/phpunit/phpunit.php:0
PHP   2. MediaWikiPHPUnitCommand::main() /vagrant/mediawiki/tests/phpunit/phpunit.php:160
PHP   3. PHPUnit_TextUI_Command->run() /vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0

Call Stack:
    0.0010     253088   1. {main}() /vagrant/mediawiki/tests/phpunit/phpunit.php:0
    0.1257    7994792   2. MediaWikiPHPUnitCommand::main() /vagrant/mediawiki/tests/phpunit/phpunit.php:160
    0.1258    8008656   3. PHPUnit_TextUI_Command->run() /vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /vagrant/mediawiki/tests/phpunit/phpunit.php:0
PHP   2. MediaWikiPHPUnitCommand::main() /vagrant/mediawiki/tests/phpunit/phpunit.php:160
PHP   3. PHPUnit_TextUI_Command->run() /vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

Call Stack:
    0.0010     253088   1. {main}() /vagrant/mediawiki/tests/phpunit/phpunit.php:0
    0.1257    7994792   2. MediaWikiPHPUnitCommand::main() /vagrant/mediawiki/tests/phpunit/phpunit.php:160
    0.1258    8008656   3. PHPUnit_TextUI_Command->run() /vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

---

I promise that the session.save_path is writable. Usual debugging methods (throwing exceptions, printing output) are difficult since PHPUnit basically takes over all output.
Comment 1 Antoine "hashar" Musso (WMF) 2014-07-08 07:02:07 UTC
PHPUnit does catch exceptions, since you might want to write a test that assert an exception is thrown.

Using either --debug or --tap shows the test name being run. Though the later most probably eat output as well.   var_dump()  should show up though.

I also have:

if( $wgCommandLineMode ) {
    $wgDebugLogFile = '/tmp/cli-trunk.log';
} else {
    $wgDebugLogFile = '/tmp/www-trunk.log';
}


This way you can use wfDebugLog('CHAD', 'something') and tail -f  /tmp/cli-trunk.log|fgrep CHAD


We also have a hidden command --debug-tests for the phpunit.php wrapper. That emit a log in PHPUnitCommand log buckets at start and completion of tests which help refine which test emitted the log:

$ cd tests/phpunit
$ php phpunit.php --debug-tests

And in /tmp/cli-trunk.log:

[PHPUnitCommand] Start test GlobalTest::testCgiToArray with data set #0
<some debug log related to that test>
[PHPUnitCommand] End test GlobalTest::testCgiToArray with data set #0




Have you tried disabling all extensions?
With a fresh LocalSettings.php?
Throwing the sessions data?
Zend vs Hiphop?

:-D
Comment 2 Chad H. 2014-07-08 13:24:49 UTC
(In reply to Antoine "hashar" Musso from comment #1)
> Have you tried disabling all extensions?

Yes

> With a fresh LocalSettings.php?

Yes

> Throwing the sessions data?

Hmm?

> Zend vs Hiphop?

Zend only. HHVM isn't affected by this.
Comment 3 Chad H. 2014-07-08 16:15:07 UTC
I tried running all the tests individually in their own process to see if I could isolate it to one misbehaving test. Surprise surprise, it didn't break then!

I'm spinning up a fresh vagrant VM, won't touch a damn thing and we'll get it breaking again I'm sure.
Comment 4 Chad H. 2014-07-08 17:15:37 UTC
Fresh VM did no good. Same results as the previous.
Comment 5 Nemo 2014-07-26 23:39:33 UTC
Same here. Can it be related to running way too many tests at once (bug 67216 comment 8)? :-)

PHP Warning:  Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:0
PHP   2. MediaWikiPHPUnitCommand::main() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160
PHP   3. PHPUnit_TextUI_Command->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0

Call Stack:
    0.0006     252912   1. {main}() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:0
    1.6730   25034984   2. MediaWikiPHPUnitCommand::main() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160
    1.6731   25047464   3. PHPUnit_TextUI_Command->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:0
PHP   2. MediaWikiPHPUnitCommand::main() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160
PHP   3. PHPUnit_TextUI_Command->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

Call Stack:
    0.0006     252912   1. {main}() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:0
    1.6730   25034984   2. MediaWikiPHPUnitCommand::main() /srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160
    1.6731   25047464   3. PHPUnit_TextUI_Command->run() /srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links