Page MenuHomePhabricator

BounceHandler extension unit tests failing on UnSubscribeUserTest::testUnSubscribeUser
Closed, ResolvedPublic

Description

Needs fixing

Using HHVM 3.18.6-dev (5.6.99-hhvm)
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

...............F.............S.S...............................  63 / 246 ( 25%)
............................................................... 126 / 246 ( 51%)
............................................................... 189 / 246 ( 76%)
.........................................................

Time: 36.13 seconds, Memory: 55.77MB

There was 1 failure:

1) UnSubscribeUserTest::testUnSubscribeUser
Failed asserting that true is false.

/workspace/src/extensions/BounceHandler/tests/phpunit/UnSubscribeUserTest.php:62
/workspace/src/tests/phpunit/MediaWikiTestCase.php:475
/workspace/src/maintenance/doMaintenance.php:94

FAILURES!
Tests: 246, Assertions: 784, Failures: 1, Skipped: 2.

Warning: Destructor threw an object exception: exception 'Wikimedia\Rdbms\DBAccessError' with message 'Database access has been disabled.' in /workspace/src/includes/libs/rdbms/loadbalancer/LoadBalancer.php:1091
Stack trace:
#0 /workspace/src/includes/libs/rdbms/loadbalancer/LoadBalancer.php(945): Wikimedia\Rdbms\LoadBalancer->reallyOpenConnection()
#1 /workspace/src/includes/libs/rdbms/loadbalancer/LoadBalancer.php(889): Wikimedia\Rdbms\LoadBalancer->openLocalConnection()
#2 /workspace/src/includes/libs/rdbms/loadbalancer/LoadBalancer.php(765): Wikimedia\Rdbms\LoadBalancer->openConnection()
#3 /workspace/src/includes/GlobalFunctions.php(2776): Wikimedia\Rdbms\LoadBalancer->getConnection()
#4 /workspace/src/extensions/CentralAuth/includes/CentralAuthHooks.php(1528): wfGetDB()
#5 /workspace/src/includes/Hooks.php(174): CentralAuthHooks::onUnitTestsBeforeDatabaseTeardown()
#6 /workspace/src/includes/Hooks.php(202): Hooks::callHook()
#7 /workspace/src/tests/phpunit/MediaWikiTestCase.php(1281): Hooks::run()
#8 /workspace/src/tests/phpunit/bootstrap.php(20): MediaWikiTestCase::teardownTestDB()
#9 (): MediaWikiPHPUnitBootstrap->__destruct()
#10 {main}

Event Timeline

Is this causing a Jenkins job for a repository that is not BounceHandler to fail? If so, a Gerrit/Jenkins link would help.

Untagged Shared-Build-Failure in that case.

Notice: I have used the tag, because it is loaded on wmf wikis -> Wikimedia-deployed extension -> tag

'wmgUseBounceHandler' => [
	'default' => true,
],

I understand, but this tag is only used if the builds of other repositories are failing as a result. I think this extension is not currently part of the shared gate which means only its own build is affected, which its maintainers can take care of normally through their own triaging process.

Some links:

  • T142134 - this test already failed two years ago because of an issue with WANObjectCache/CAS in MediaWiki core
  • T201290 - about the warning in destructor failing in a CentralAuth hook, possibly not the cause of this failed test but it adds noise and complexity in this case

After more tests on my local installation, this test fails if and only if CentralAuth is activated on the wiki. Hence there is a high probability that resolution of T201290 will imply resolution of this bug.

I now have a good understanding of the issue, and my comments above were not completely exact.

This test catches a real bug: when CentralAuth is installed but the user is not attached on the local wiki, then the user with failing emails escapes its unsubscribing. I prepare a patch for this. T201290 is more likely independent; I don’t have the warning on my local installation.

The next question is why this test didn’t fail before. I tried with versions from MediaWiki, BounceHandler and CentralAuth from around May 2018 and it failed. Hence I guess there was some change in the CI infrastructure during July 2018, e.g. CentralAuth and BounceHandler were not tested together before. @hashar: is this hypothesis correct?

Change 462294 had a related patch set uploaded (by Seb35; owner: Seb35):
[mediawiki/extensions/BounceHandler@master] Unsubscribe the local user if the global user is not attached

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

Seb35 triaged this task as Medium priority.Sep 23 2018, 2:08 PM

Change 462294 merged by jenkins-bot:
[mediawiki/extensions/BounceHandler@master] Unsubscribe the local user if the global user is not attached

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

Seb35 claimed this task.

Fixed. Jenkins jobs no more detect "false positive" errors for recent patches.

Change 652926 had a related patch set uploaded (by Legoktm; owner: Seb35):
[mediawiki/extensions/BounceHandler@REL1_31] Unsubscribe the local user if the global user is not attached

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

Change 652926 merged by Legoktm:
[mediawiki/extensions/BounceHandler@REL1_31] Unsubscribe the local user if the global user is not attached

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