Page MenuHomePhabricator

MediaWiki PHPUnit test suite can result in non-test database being modified
Closed, ResolvedPublic

Description

TL;DR: A bug in MariaDB 11.2.2 (possibly earlier 11.2.x, but seemingly not 11.1.3 yet), MDEV-32973, confused MediaWiki’s integration test setup; subsequent tests erroneously thought the test DB had been set up already, skipped setting it up again, and ran against the real DB. MediaWiki has been fixed to (try to) repeat the test DB setup in each test if it previously failed (Gerrit change); the MariaDB bug is also getting fixed.


I’ve somehow gotten my local development wiki into a state where running PHPUnit tests results in the real wiki database getting wiped. To my knowledge, this is something that should never ever ever happen.

For me, the steps to reproduce are quite simple:

  1. Have a database backup. Mine is unfortunately a few months old, but it’s the best I have now. If you’re experimenting with this task, make sure you have a more recent backup if you value your test data.
  2. Load the main page of your wiki in the browser. Confirm it shows up.
  3. Run (in the mw core directory): composer phpunit:entrypoint -- extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialNewItemTest.php
  4. Reload the main page. Observe that it’s gone now.
  5. Restore your database backup.

But presumably this error doesn’t happen for everyone, so it remains to be seen which parts of my setup are relevant to this.

The test output is:

> phpunit '-c' 'tests/phpunit/suite.xml' 'extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialNewItemTest.php'
Using PHP 8.2.13
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

E..................E.......                                       27 / 27 (100%)

You should really speed up these slow tests (>50ms)...
 1. 259ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testIdGeneratorRateLimit
 2. 228ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testErrorBeingDisplayed_WhenItemWithTheSameLabelAndDescriptionInThisLanguageAlreadyExists
 3. 193ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testSiteAndPageInputFieldsWithPredefinedValuesPresent_WhenRenderedWithGetParametersPassed
 4. 187ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testEntityIsBeingCreated_WhenValidInputIsGiven with data set "multiple aliases"
 5. 160ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testEntityIsBeingCreated_WhenValidInputIsGiven with data set "another language"
 6. 160ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testEntityIsBeingCreated_WhenValidInputIsGiven with data set "nontrimmed description"
 7. 151ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testEntityIsBeingCreated_WhenValidInputIsGiven with data set "only label is set"
 8. 151ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testEntityIsBeingCreated_WhenValidInputIsGiven with data set "all input is present"
 9. 147ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testEntityIsBeingCreated_WhenValidInputIsGiven with data set "nontrimmed label"
 10. 145ms to run Wikibase\\Repo\\Tests\\Specials\\SpecialNewItemTest::testEntityIsBeingCreated_WhenValidInputIsGiven with data set "single alias"
...and there are 14 more above your threshold hidden from view


Time: 00:02.880, Memory: 101.50 MB

There were 2 errors:

1) Wikibase\Repo\Tests\Specials\SpecialNewItemTest::testAllNecessaryFormFieldsArePresent_WhenRendered
Wikimedia\Rdbms\DBQueryError: Error 1051: Unknown table 'wiki1.unittest_abuse_filter_action'
Function: CloneDatabase::cloneTableStructure
Query: DROP TABLE `unittest_abuse_filter_action` CASCADE


/srv/http/wiki1/includes/libs/rdbms/database/Database.php:1230
/srv/http/wiki1/includes/libs/rdbms/database/Database.php:1214
/srv/http/wiki1/includes/libs/rdbms/database/Database.php:1188
/srv/http/wiki1/includes/libs/rdbms/database/Database.php:674
/srv/http/wiki1/includes/libs/rdbms/database/Database.php:3022
/srv/http/wiki1/includes/db/CloneDatabase.php:103
/srv/http/wiki1/tests/phpunit/MediaWikiIntegrationTestCase.php:1749
/srv/http/wiki1/tests/phpunit/MediaWikiIntegrationTestCase.php:1813
/srv/http/wiki1/tests/phpunit/MediaWikiIntegrationTestCase.php:1768
/srv/http/wiki1/tests/phpunit/MediaWikiIntegrationTestCase.php:683
/srv/http/wiki1/tests/phpunit/MediaWikiIntegrationTestCase.php:631
=== Logs generated by test case
[wfDebug] [debug] CloneDatabase::cloneTableStructure dropping unittest_abuse_filter {"private":false}
[wfDebug] [debug] CloneDatabase::cloneTableStructure duplicating abuse_filter to unittest_abuse_filter {"private":false}
===

2) Wikibase\Repo\Tests\Specials\SpecialNewItemTest::testExceptionWhenUserBlockedOnNamespace
RuntimeException: Can't create user on real database

/srv/http/wiki1/tests/phpunit/includes/TestUser.php:35
/srv/http/wiki1/tests/phpunit/includes/TestUser.php:42
/srv/http/wiki1/tests/phpunit/includes/TestUserRegistry.php:78
/srv/http/wiki1/tests/phpunit/MediaWikiIntegrationTestCase.php:285
/srv/http/wiki1/extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialNewEntityTestCase.php:65
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"HashBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[localisation] [debug] LocalisationCache::loadCoreData: got localisation for qqx from source []
===

ERRORS!
Tests: 27, Assertions: 49, Errors: 2.
Script phpunit handling the phpunit event returned with error code 2
Script @phpunit -c tests/phpunit/suite.xml was called via phpunit:entrypoint

My interpretation is that the first error causes all of MediaWikiIntegrationTestCase::setupDatabaseWithTestPrefix() and its callers to fail, which means the rest of the test suite runs against the real database. Some of the tests then touch the page table, causing it to be wiped during teardown. Eventually, the second error indicates that TestUser detects that the tests are targeting the main database.

Not all tests appear to be affected: Wikibase’s SpecialSetLabelTest, for instance, also shows similar errors (1× unknown table unittest_abuse_filter_action, 4× can’t create user on real database), but doesn’t seem to wipe the database as far as I can tell. I’m not yet sure why (SpecialSetLabelTest should also touch the page table as far as I can tell).

Event Timeline

NewEntitySchemaTest in EntitySchema causes the same effect (test failure first observed on Friday, though at the time I didn’t notice the effect on my database). Haven’t found a core test that triggers it yet, but I assume it’s not specific to Wikibase codebases.

Okay, tests/phpunit/includes/editpage/EditPageTest.php (in core) has the same effect as well.

  1. Wikibase\Repo\Tests\Specials\SpecialNewItemTest::testAllNecessaryFormFieldsArePresent_WhenRendered

Wikimedia\Rdbms\DBQueryError: Error 1051: Unknown table 'wiki1.unittest_abuse_filter_action'
Function: CloneDatabase::cloneTableStructure
Query: DROP TABLE unittest_abuse_filter_action CASCADE

So far the error always mentions this particular table, by the way – although that could just be because it’s the first alphabetically (ABuse…). This still happens even if I stop loading the AbuseFilter extension. (I guess it just tries to clone every table, regardless of whether it’s registered by a loaded extension or not?)

This patch does not fix the issue – apparently the table cannot be dropped but nevertheless exists:

diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php
index 43e5513b82..156f6f18d0 100644
--- a/includes/db/CloneDatabase.php
+++ b/includes/db/CloneDatabase.php
@@ -100,9 +100,11 @@ public function cloneTableStructure() {
 					throw new LogicException( "Not dropping new table, as '$newTableName'"
 						. " is name of both the old and the new table." );
 				}
-				$this->db->dropTable( $tbl, __METHOD__ );
-				wfDebug( __METHOD__ . " dropping {$newTableName}" );
-				// Dropping the oldTable because the prefix was changed
+				if ( $this->db->tableExists( $tbl, __METHOD__ ) ) {
+					$this->db->dropTable( $tbl, __METHOD__ );
+					wfDebug( __METHOD__ . " dropping {$newTableName}" );
+					// Dropping the oldTable because the prefix was changed
+				}
 			}
 
 			# Create new table

But that points me in the right direction: if I set PHPUNIT_USE_NORMAL_TABLES=false, then the test passes. Something seems to be messed up with temporary tables. (I wonder if it’s a MariaDB bug… apparently I installed a new version, 11.2.2-1 of mariadb, on 24 November, which is relatively recent.)

  1. Wikibase\Repo\Tests\Specials\SpecialNewItemTest::testAllNecessaryFormFieldsArePresent_WhenRendered

Wikimedia\Rdbms\DBQueryError: Error 1051: Unknown table 'wiki1.unittest_abuse_filter_action'
Function: CloneDatabase::cloneTableStructure
Query: DROP TABLE unittest_abuse_filter_action CASCADE

So far the error always mentions this particular table, by the way – although that could just be because it’s the first alphabetically (ABuse…).

It’s not quite the first table, by the way. Stepping through CloneDatabase::cloneTableStructure() with the debugger reveals that abuse_filter is first, and is successfully dropped. abuse_filter_action is then the second table, and fails.

I wonder if the abuse_filter drop somehow cascades through to abuse_filter_action, dropping it prematurely… but I don’t see any kind of foreign key relation between the two.

(I wonder if it’s a MariaDB bug… apparently I installed a new version, 11.2.2-1 of mariadb, on 24 November, which is relatively recent.)

I can’t say for sure whether it’s a bug or not, but the error vanishes if I downgrade MariaDB (mariadb, mariadb-libs, mariadb-clients) to 11.1.3-1.

Tagging DBAs – not urgent, and I know you’re dealing with an incident at the moment, but when you have some time, I assume y’all know how best to report bugs upstream? And/or could perhaps help me investigate this further?

(Also, even if the changed MariaDB behavior turns out to be a bug, MediaWiki should still handle the error better. Falling back to the non-test DB should never happen. If we can’t set up the cloned DB, abort the tests, by exit() if necessary.)

This patch does not fix the issue – apparently the table cannot be dropped but nevertheless exists:

diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php
index 43e5513b82..156f6f18d0 100644
--- a/includes/db/CloneDatabase.php
+++ b/includes/db/CloneDatabase.php
@@ -100,9 +100,11 @@ public function cloneTableStructure() {
 					throw new LogicException( "Not dropping new table, as '$newTableName'"
 						. " is name of both the old and the new table." );
 				}
-				$this->db->dropTable( $tbl, __METHOD__ );
-				wfDebug( __METHOD__ . " dropping {$newTableName}" );
-				// Dropping the oldTable because the prefix was changed
+				if ( $this->db->tableExists( $tbl, __METHOD__ ) ) {
+					$this->db->dropTable( $tbl, __METHOD__ );
+					wfDebug( __METHOD__ . " dropping {$newTableName}" );
+					// Dropping the oldTable because the prefix was changed
+				}
 			}
 
 			# Create new table

It turns out this patch is completely redundant. Database::dropTable(), at the very beginning, checks tableExists().

But: Changes and Improvements in MariaDB 11.2 mentions:

Temporary tables are now displayed in the Information Schema TABLES Table, SHOW TABLES and SHOW TABLE STATUS (MDEV-12459)

So this could be the relevant change here? tableExists() previously never showed the temporary table, so MediaWiki never issued the DROP query; but now it shows the temporary table, and so MediaWiki sends a DROP for it?

Still don’t know why it can’t be dropped, though…

(I wonder if it’s a MariaDB bug… apparently I installed a new version, 11.2.2-1 of mariadb, on 24 November, which is relatively recent.)

I can’t say for sure whether it’s a bug or not, but the error vanishes if I downgrade MariaDB (mariadb, mariadb-libs, mariadb-clients) to 11.1.3-1.

Tagging DBAs – not urgent, and I know you’re dealing with an incident at the moment, but when you have some time, I assume y’all know how best to report bugs upstream? And/or could perhaps help me investigate this further?

MariaDB 11.1 is still incredibly new and I'd not recommend using it in production/serious environment.

If downgrading works, you can always file a bug report via jira.mariadb.org (you need to register for that).
If I were you, I'd try the same with 10.6 and see if you get the same behaviour

MariaDB appears to be… returning the just-created unittest_abuse_filter table as a result of SHOW TABLES LIKE 'unittest_abuse_filter_action';, i.e. when MediaWiki is checking whether abuse_filter_action needs to be deleted before it’s created? o_O

image.png (103×664 px, 18 KB)

Okay, am I being stupid about how SQL works, or is this a MariaDB bug after all? Isolated example:

MariaDB [wiki1]> CREATE TEMPORARY TABLE T352695 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT);
Query OK, 0 rows affected (0.001 sec)

MariaDB [wiki1]> SHOW TABLES LIKE 'T352695abcde';
+--------------------------------+
| Tables_in_wiki1 (T352695abcde) |
+--------------------------------+
| T352695                        |
+--------------------------------+
1 row in set (0.000 sec)

Apparently a temporary table with the name _ can match any SHOW TABLES LIKE query.

MariaDB [wiki1]> CREATE TEMPORARY TABLE _ (a INT);
Query OK, 0 rows affected (0.001 sec)

MariaDB [wiki1]> SHOW TABLES LIKE 'T352695';
+---------------------------+
| Tables_in_wiki1 (T352695) |
+---------------------------+
| _                         |
+---------------------------+
1 row in set (0.001 sec)

@Lucas_Werkmeister_WMDE thanks for filing this. I see the same behavior when running extensions/DiscussionTools/tests/phpunit/ThreadItemStoreTest.php, I am on MariaDB 11.1.3.

@Lucas_Werkmeister_WMDE thanks for filing this. I see the same behavior when running extensions/DiscussionTools/tests/phpunit/ThreadItemStoreTest.php, I am on MariaDB 11.1.3.

After downgrading to 10.6, I don't see this problem.

Apparently a temporary table with the name _ can match any SHOW TABLES LIKE query.

MariaDB [wiki1]> CREATE TEMPORARY TABLE _ (a INT);
Query OK, 0 rows affected (0.001 sec)

MariaDB [wiki1]> SHOW TABLES LIKE 'T352695';
+---------------------------+
| Tables_in_wiki1 (T352695) |
+---------------------------+
| _                         |
+---------------------------+
1 row in set (0.001 sec)

That's a bug, SHOW TABLES like '_352695'; should show the table because _ is a wildcard for 1 character, but it shouldn't work the other way around, and looks scary, security-wise!!!!!

@Lucas_Werkmeister_WMDE thanks for filing this. I see the same behavior when running extensions/DiscussionTools/tests/phpunit/ThreadItemStoreTest.php, I am on MariaDB 11.1.3.

Based on the official docs, temporary tables should be shown by SHOW TABLES only starting with maria-db 11.2: https://mariadb.com/kb/en/show-tables/

So this looks like an incomplete feature unintentionally enabled prematurely?

@Lucas_Werkmeister_WMDE thanks for filing this. I see the same behavior when running extensions/DiscussionTools/tests/phpunit/ThreadItemStoreTest.php, I am on MariaDB 11.1.3.

Strange, for me MariaDB 11.1.3 is the version where the bug doesn’t happen yet…

That's a bug, SHOW TABLES like '_352695'; should show the table because _ is a wildcard for 1 character, but it shouldn't work the other way around, and looks scary, security-wise!!!!!

Thanks for confirming :)

That was the closest task I found on their bugtracker too, but it seems to be about a slightly different command / query, and was also supposed to be fixed in 11.2.1 (I’m on 11.2.2). I guess the next step would be to report a new task there… do you want to do it (better contacts) or should I?

I can also reproduce the issue with their official Docker images btw:

  1. docker run --rm --env MARIADB_ROOT_PASSWORD=root --name=T352695 mariadb:latest
  2. docker exec -it T352695 mariadb -uroot -proot
  3. CREATE DATABASE db; USE db;
  4. CREATE TEMPORARY TABLE a (a INT);
  5. SHOW TABLES LIKE 'b';

It's up to you if you want to report it, if not I'll do it. Whatever is easier for you

@Lucas_Werkmeister_WMDE thanks for filing this. I see the same behavior when running extensions/DiscussionTools/tests/phpunit/ThreadItemStoreTest.php, I am on MariaDB 11.1.3.

Strange, for me MariaDB 11.1.3 is the version where the bug doesn’t happen yet…

That's a bug, SHOW TABLES like '_352695'; should show the table because _ is a wildcard for 1 character, but it shouldn't work the other way around, and looks scary, security-wise!!!!!

Thanks for confirming :)

That was the closest task I found on their bugtracker too, but it seems to be about a slightly different command / query, and was also supposed to be fixed in 11.2.1 (I’m on 11.2.2). I guess the next step would be to report a new task there… do you want to do it (better contacts) or should I?

I can also reproduce the issue with their official Docker images btw:

  1. docker run --rm --env MARIADB_ROOT_PASSWORD=root --name=T352695 mariadb:latest
  2. docker exec -it T352695 mariadb -uroot -proot
  3. CREATE DATABASE db; USE db;
  4. CREATE TEMPORARY TABLE a (a INT);
  5. SHOW TABLES LIKE 'b';

If this is the exact way to reproduce (please confirm), it doesn't happen with 11.1

root@db1106.eqiad.wmnet[enwiki]> CREATE DATABASE db; USE db;
Query OK, 1 row affected (0.001 sec)

Database changed
root@db1106.eqiad.wmnet[db]> CREATE TEMPORARY TABLE a (a INT);
Query OK, 0 rows affected (0.001 sec)

root@db1106.eqiad.wmnet[db]> SHOW TABLES LIKE 'b';
Empty set (0.001 sec)

root@db1106.eqiad.wmnet[db]> select @@version;
+--------------------+
| @@version          |
+--------------------+
| 11.1.0-MariaDB-log |
+--------------------+
1 row in set (0.001 sec)

It's up to you if you want to report it, if not I'll do it. Whatever is easier for you

Alright, I’ll do that tomorrow (not enough time today).

If this is the exact way to reproduce (please confirm), it doesn't happen with 11.1

That should be it, yeah. I’ll try it with different Docker versions tomorrow.

Once you've reported it please paste the link, so I can ping some MariaDB people that might be interested in seeing this.

The MariaDB issue can be worked around with something like:

diff --git a/includes/libs/rdbms/database/DatabaseMySQL.php b/includes/libs/rdbms/database/DatabaseMySQL.php
index 817f2a3242..3e2bb672d8 100644
--- a/includes/libs/rdbms/database/DatabaseMySQL.php
+++ b/includes/libs/rdbms/database/DatabaseMySQL.php
@@ -321,7 +321,16 @@ public function tableExists( $table, $fname = __METHOD__ ) {
 		$query = new Query( $sql, self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE, 'SHOW', $table );
 		$res = $this->query( $query, $fname );
 
-		return $res->numRows() > 0;
+		foreach ( $res as $row ) {
+			$returnedTableName = reset( $row );
+			if ( $returnedTableName === $tableName ) {
+				return true;
+			} else {
+				wfWarn( "Database returned mismatching name $returnedTableName for requested $tableName (query: $sql), T352695 / MDEV-32973?", 1, false );
+			}
+		}
+
+		return false;
 	}
 
 	/**

Note that the use of nonstandard false for the wfWarn “level” is necessary to avoid throwing an error during the tests, because if an error is thrown, we just get the same behavior as before. This is still something that needs to be fixed in MediaWiki as well (T352695#9380189) – errors during test DB setup should not result in the tests running against the real DB instead.

Change 981555 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] Only set $dbSetup if setupTestDB() ends without throwing

https://gerrit.wikimedia.org/r/981555

(Also, even if the changed MariaDB behavior turns out to be a bug, MediaWiki should still handle the error better. Falling back to the non-test DB should never happen. If we can’t set up the cloned DB, abort the tests, by exit() if necessary.)

Note that the use of nonstandard false for the wfWarn “level” is necessary to avoid throwing an error during the tests, because if an error is thrown, we just get the same behavior as before. This is still something that needs to be fixed in MediaWiki as well (T352695#9380189) – errors during test DB setup should not result in the tests running against the real DB instead.

Should be fixed with tests: Only set $dbSetup if setupTestDB() ends without throwing, I think; when I apply that and run the tests from the task description T352695#9380022, I get the same DBQueryError in all six tests, which makes sense (each of them tries and fails to repeat the setup now, then crashes without clobbering the real database).

Change 981555 merged by jenkins-bot:

[mediawiki/core@master] tests: Only set $dbSetup if setupTestDB() ends without throwing

https://gerrit.wikimedia.org/r/981555

I think we can close this? The MediaWiki side should be fixed, and the MariaDB side is being fixed as well but we don’t really have to wait for that imho.

The MariaDB issue can be worked around with something like:

diff --git a/includes/libs/rdbms/database/DatabaseMySQL.php b/includes/libs/rdbms/database/DatabaseMySQL.php
index 817f2a3242..3e2bb672d8 100644
--- a/includes/libs/rdbms/database/DatabaseMySQL.php
+++ b/includes/libs/rdbms/database/DatabaseMySQL.php
@@ -321,7 +321,16 @@ public function tableExists( $table, $fname = __METHOD__ ) {
 		$query = new Query( $sql, self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE, 'SHOW', $table );
 		$res = $this->query( $query, $fname );
 
-		return $res->numRows() > 0;
+		foreach ( $res as $row ) {
+			$returnedTableName = reset( $row );
+			if ( $returnedTableName === $tableName ) {
+				return true;
+			} else {
+				wfWarn( "Database returned mismatching name $returnedTableName for requested $tableName (query: $sql), T352695 / MDEV-32973?", 1, false );
+			}
+		}
+
+		return false;
 	}
 
 	/**

Note that the use of nonstandard false for the wfWarn “level” is necessary to avoid throwing an error during the tests, because if an error is thrown, we just get the same behavior as before. This is still something that needs to be fixed in MediaWiki as well (T352695#9380189) – errors during test DB setup should not result in the tests running against the real DB instead.

Hm, do we want to apply a patch like this to MediaWiki as well, to work around the specific MariaDB bug? (We could skip the nonstandard wfWarn level now.) But if they fix this issue quickly, I don’t think that’s really necessary tbh. (In general, it’s probably not the responsibility of our rdbms library to sanity-check the database implementation.)

But if they fix this issue quickly, I don’t think that’s really necessary tbh.

Well, the proposed pull request for MariaDB still hasn’t been merged :S and as I just ran into this issue again while looking into T360435, I suppose we should at least backport the MediaWiki core fix.

Change #1017801 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@REL1_41] tests: Only set $dbSetup if setupTestDB() ends without throwing

https://gerrit.wikimedia.org/r/1017801

Change #1017802 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@REL1_40] tests: Only set $dbSetup if setupTestDB() ends without throwing

https://gerrit.wikimedia.org/r/1017802

Change #1017803 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@REL1_39] tests: Only set $dbSetup if setupTestDB() ends without throwing

https://gerrit.wikimedia.org/r/1017803

Change #1017801 merged by jenkins-bot:

[mediawiki/core@REL1_41] tests: Only set $dbSetup if setupTestDB() ends without throwing

https://gerrit.wikimedia.org/r/1017801

Change #1017803 merged by jenkins-bot:

[mediawiki/core@REL1_39] tests: Only set $dbSetup if setupTestDB() ends without throwing

https://gerrit.wikimedia.org/r/1017803

Change #1017802 merged by jenkins-bot:

[mediawiki/core@REL1_40] tests: Only set $dbSetup if setupTestDB() ends without throwing

https://gerrit.wikimedia.org/r/1017802