Make doTestLockCalls() faster
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 14 Sep 2019 05:41:10 +0000 (22:41 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 14 Sep 2019 05:41:13 +0000 (22:41 -0700)
This was mostly doing many runs just to test for random lock errors in
versions of Windows from a few years back. Just do three quick rounds.

Change-Id: I2ec2a8ce66a5c14bfc9338b60f8a57b2de8eaece

tests/phpunit/includes/filebackend/FileBackendTest.php

index 3b30d7e..e344d57 100644 (file)
@@ -2422,7 +2422,7 @@ class FileBackendTest extends MediaWikiTestCase {
                        "$base/subdir2/subdir/sub/120-px-file.txt",
                ];
 
-               for ( $i = 0; $i < 25; $i++ ) {
+               for ( $i = 0; $i < 2; $i++ ) {
                        $status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX );
                        $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ),
                                "Locking of files succeeded ($backendName) ($i)." );