From 93c4cfd71f1bfa7bb9baca38e1a0a1e18d4d0db9 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 11 Dec 2015 15:45:05 -0800 Subject: [PATCH] Cleanup test jobs better Change-Id: Id89bb6e9056485b51c66569a57cb91bdf9d2d91f --- tests/phpunit/MediaWikiTestCase.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 9e4a984653..fc2f743e12 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -520,10 +520,17 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @since 1.21 */ public static function teardownTestDB() { + global $wgJobClasses; + if ( !self::$dbSetup ) { return; } + foreach ( $wgJobClasses as $type => $class ) { + // Delete any jobs under the clone DB (or old prefix in other stores) + JobQueueGroup::singleton()->get( $type )->delete(); + } + CloneDatabase::changePrefix( self::$oldTablePrefix ); self::$oldTablePrefix = false; -- 2.20.1