Disable CAS check when saving TestUser data.
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 19 May 2016 12:51:04 +0000 (14:51 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Tue, 24 May 2016 10:58:22 +0000 (12:58 +0200)
commit8f4587b34381926188f3d30a0f981cedd0f69235
tree8de231600c29de95f662694be87cda597632cb90
parent87fe1a21bdadec75ef25257c8bd3fcedc024114e
Disable CAS check when saving TestUser data.

During testing, we are not worried about data loss, so we can safely
bypass the CAS check when setting up a test fixture.

This change was added to address sporadic test failures like the following:

18:03:38 1) ApiEchoMarkReadTest::testMarkReadWithList
18:03:38 MWException: CAS update failed on user_touched for user ID '2' (read from slave); the version of the user to be saved is older than the current version.
18:03:38
18:03:38 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/includes/user/User.php:3931
18:03:38 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/tests/phpunit/includes/TestUser.php:83
18:03:38 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/tests/phpunit/includes/api/ApiTestCase.php:30
18:03:38 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/extensions/Echo/tests/phpunit/api/ApiEchoMarkReadTest.php:11
18:03:38 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/tests/phpunit/MediaWikiTestCase.php:370

Bug: T131178
Change-Id: I99b43e0db85bc2c1cd335c82971df4e95520d34b
includes/user/User.php
tests/phpunit/includes/TestUser.php