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}

Details

Related Gerrit Patches:
mediawiki/extensions/BounceHandler : masterUnsubscribe the local user if the global user is not attached

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 21 2018, 8:37 PM

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.

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.

Seb35 added a subscriber: Seb35.Sep 23 2018, 8:59 AM

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

The CI fails systematically since 17 August 2018 (list of changes in Gerrit). The two first jobs failing are https://gerrit.wikimedia.org/r/453327 and https://gerrit.wikimedia.org/r/454366.

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.

Seb35 added a subscriber: hashar.Sep 23 2018, 1:46 PM

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 closed this task as Resolved.Nov 18 2018, 5:17 PM
Seb35 claimed this task.

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