diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2024-05-29 00:23:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2024-05-29 00:23:16 +0000 |
commit | 68593e5c5a6ea23e9b9a8eda5962555fa33f53e0 (patch) | |
tree | 07b0c8a05bd2c6964c5503468e7dd27ef3b65dd9 /tests/phpunit/includes/db/LBFactoryTest.php | |
parent | e478e4627ed57918b06e1a685e001cbe87c70e28 (diff) | |
parent | 091f58c44104b1d35007155d84b1fcc357cbd0d0 (diff) | |
download | mediawikicore-68593e5c5a6ea23e9b9a8eda5962555fa33f53e0.tar.gz mediawikicore-68593e5c5a6ea23e9b9a8eda5962555fa33f53e0.zip |
Merge "rdbms: Drop IDatabase::getTopologyRole()"
Diffstat (limited to 'tests/phpunit/includes/db/LBFactoryTest.php')
-rw-r--r-- | tests/phpunit/includes/db/LBFactoryTest.php | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/tests/phpunit/includes/db/LBFactoryTest.php b/tests/phpunit/includes/db/LBFactoryTest.php index 2669639be1bb..67a5a450e715 100644 --- a/tests/phpunit/includes/db/LBFactoryTest.php +++ b/tests/phpunit/includes/db/LBFactoryTest.php @@ -75,12 +75,9 @@ class LBFactoryTest extends MediaWikiIntegrationTestCase { $lb = $factory->getMainLB(); $dbw = $lb->getConnection( DB_PRIMARY ); - $this->assertEquals( - $dbw::ROLE_STREAMING_MASTER, $dbw->getTopologyRole(), 'master shows as master' ); - + $this->assertNotFalse( $dbw ); $dbr = $lb->getConnection( DB_REPLICA ); - $this->assertEquals( - $dbr::ROLE_STREAMING_MASTER, $dbw->getTopologyRole(), 'replica shows as replica' ); + $this->assertNotFalse( $dbr ); $this->assertSame( 'DEFAULT', $lb->getClusterName() ); @@ -103,16 +100,9 @@ class LBFactoryTest extends MediaWikiIntegrationTestCase { $lb = $factory->getMainLB(); $dbw = $lb->getConnection( DB_PRIMARY ); - $dbw->ensureConnection(); - - $this->assertEquals( - $dbw::ROLE_STREAMING_MASTER, $dbw->getTopologyRole(), 'primary shows as primary' ); - + $this->assertNotFalse( $dbw ); $dbr = $lb->getConnection( DB_REPLICA ); - $dbr->ensureConnection(); - - $this->assertEquals( - $dbr::ROLE_STREAMING_REPLICA, $dbr->getTopologyRole(), 'replica shows as replica' ); + $this->assertNotFalse( $dbr ); $factory->shutdown(); } @@ -122,13 +112,11 @@ class LBFactoryTest extends MediaWikiIntegrationTestCase { $this->assertSame( 's3', $factory->getMainLB()->getClusterName() ); - $dbw = $factory->getMainLB()->getConnection( DB_PRIMARY ); - $this->assertEquals( - $dbw::ROLE_STREAMING_MASTER, $dbw->getTopologyRole(), 'master shows as master' ); - - $dbr = $factory->getMainLB()->getConnection( DB_REPLICA ); - $this->assertEquals( - $dbr::ROLE_STREAMING_REPLICA, $dbr->getTopologyRole(), 'replica shows as replica' ); + $lb = $factory->getMainLB(); + $dbw = $lb->getConnection( DB_PRIMARY ); + $this->assertNotFalse( $dbw ); + $dbr = $lb->getConnection( DB_REPLICA ); + $this->assertNotFalse( $dbr ); // Destructor should trigger without round stage errors unset( $factory ); @@ -783,7 +771,6 @@ class LBFactoryTest extends MediaWikiIntegrationTestCase { // Connection refs should detect the config change, close the old connection, // and get a new connection. $this->assertTrue( $ref->isOpen() ); - $this->assertSame( IDatabase::ROLE_STREAMING_MASTER, $ref->getTopologyRole() ); // The old connection should have been closed by DBConnRef. $this->assertFalse( $con->isOpen() ); @@ -848,7 +835,6 @@ class LBFactoryTest extends MediaWikiIntegrationTestCase { // Connection refs should detect the config change, close the old connection, // and get a new connection. $this->assertTrue( $ref->isOpen() ); - $this->assertSame( IDatabase::ROLE_STREAMING_REPLICA, $ref->getTopologyRole() ); // The old connection should have been closed by DBConnRef. $this->assertFalse( $con->isOpen() ); } @@ -905,7 +891,6 @@ class LBFactoryTest extends MediaWikiIntegrationTestCase { // Connection refs should detect the config change, close the old connection, // and get a new connection. $this->assertTrue( $ref->isOpen() ); - $this->assertSame( IDatabase::ROLE_STREAMING_MASTER, $ref->getTopologyRole() ); // The old connection should have been called by DBConnRef. $this->assertFalse( $con->isOpen() ); |