Page MenuHomePhabricator

PageUpdaterTest fails when run in isolation due to setTempTableOnlyMode() being called with wrong domain.
Closed, ResolvedPublic

Description

PageUpdaterTest and DerivedPageDataUpdaterTest fail when run in isolation.
The failure was obscured by the fact that they work if run after other tests that used schema overrides, like PreMcrRevisionStoreDBTest.

Analysis:
In response to T202116, Ib3e80eb introduced LoadBalancer::setTempTableOnlyMode() to suppresses the CONN_TRX_AUTOCOMMIT flag for a given domain. This is intended to ensure that integration tests don't use an additional database connection that is lacking the "fake" temporary tables with the "unittest_". Table prefix.

However, for this to work, the database domain passed to setTempTableOnlyMode has to include this table prefix. $lb->getLocalDomain() however does not, since MediaWikiIntegrationTestCase::setupDatabaseWithTestPrefix() sets the prefix on the connection, not the LB.

Solution:
Get the domain for setTempTableOnlyMode() from $db->getDomainID(), so it includes the freshly set table prefix.

Event Timeline

daniel created this task.Sep 27 2019, 11:27 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 27 2019, 11:27 AM

Change 539514 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] MWTestCase: include table prefix in domain for temp table only mode.

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

Change 539514 merged by jenkins-bot:
[mediawiki/core@master] MWTestCase: include table prefix in domain for temp table only mode.

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

Aklapper removed a subscriber: Anomie.Oct 16 2020, 5:38 PM