← Back to team overview

mahara-contributors team mailing list archive

[Bug 1515794] Re: phpunit database teardown is incomplete

 

MySQL:

[INF] ce (lib/phpunit.php:159) Installing blocktype.blog/taggedposts
[DBG] ce (lib/dml.php:150) mysqli error: [1050: Table 'tst_blocktype_taggedposts_tags' already exists] in adodb_throw(CREATE TABLE tst_blocktype_taggedposts_tags (
[DBG] ce (lib/dml.php:150)     id BIGINT(10) NOT NULL auto_increment,
[DBG] ce (lib/dml.php:150)     block_instance BIGINT(10) NOT NULL,
[DBG] ce (lib/dml.php:150)     tag VARCHAR(128) NOT NULL,
[DBG] ce (lib/dml.php:150)     tagtype BIGINT(10) NOT NULL,
[DBG] ce (lib/dml.php:150) CONSTRAINT  PRIMARY KEY (id)
[DBG] ce (lib/dml.php:150) )ENGINE=innodb, )
[DBG] ce (lib/dml.php:150) Command was: CREATE TABLE tst_blocktype_taggedposts_tags (
[DBG] ce (lib/dml.php:150)     id BIGINT(10) NOT NULL auto_increment,
[DBG] ce (lib/dml.php:150)     block_instance BIGINT(10) NOT NULL,
[DBG] ce (lib/dml.php:150)     tag VARCHAR(128) NOT NULL,
[DBG] ce (lib/dml.php:150)     tagtype BIGINT(10) NOT NULL,
[DBG] ce (lib/dml.php:150) CONSTRAINT  PRIMARY KEY (id)
[DBG] ce (lib/dml.php:150) )ENGINE=innodb
[DBG] ce (lib/ddl.php:753) Array
[DBG] ce (lib/ddl.php:753) (
[DBG] ce (lib/ddl.php:753)     [0] => CREATE TABLE tst_blocktype_taggedposts_tags (
[DBG] ce (lib/ddl.php:753)     id BIGINT(10) NOT NULL auto_increment,
[DBG] ce (lib/ddl.php:753)     block_instance BIGINT(10) NOT NULL,
[DBG] ce (lib/ddl.php:753)     tag VARCHAR(128) NOT NULL,
[DBG] ce (lib/ddl.php:753)     tagtype BIGINT(10) NOT NULL,
[DBG] ce (lib/ddl.php:753) CONSTRAINT  PRIMARY KEY (id)
[DBG] ce (lib/ddl.php:753) )ENGINE=innodb
[DBG] ce (lib/ddl.php:753) )
[DBG] ce (lib/ddl.php:753) 
PHP Fatal error:  Uncaught exception 'SQLException' with message 'Failed to install (check logs for xmldb errors)' in /home/aaronw/www/mahara/htdocs/lib/ddl.php:754
Stack trace:
#0 /home/aaronw/www/mahara/htdocs/lib/upgrade.php(429): install_from_xmldb_file('/home/aaronw/ww...')
#1 /home/aaronw/www/mahara/htdocs/lib/phpunit.php(173): upgrade_plugin(Object(stdClass))
#2 /home/aaronw/www/mahara/htdocs/lib/tests/phpunit/bootstrap.php(34): UnitTestBootstrap->install_mahara()
#3 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php(92): include_once('/home/aaronw/ww...')
#4 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php(76): PHPUnit_Util_Fileloader::load('/home/aaronw/ww...')
#5 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(778): PHPUnit_Util_Fileloader::checkAndLoad('/home/aaronw/ww...')
#6 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(606): PHPUnit_TextUI_Command->handleBootstrap('/home/aaro in /home/aaronw/www/mahara/htdocs/lib/ddl.php on line 754

Fatal error: Uncaught exception 'SQLException' with message 'Failed to install (check logs for xmldb errors)' in /home/aaronw/www/mahara/htdocs/lib/ddl.php:754
Stack trace:
#0 /home/aaronw/www/mahara/htdocs/lib/upgrade.php(429): install_from_xmldb_file('/home/aaronw/ww...')
#1 /home/aaronw/www/mahara/htdocs/lib/phpunit.php(173): upgrade_plugin(Object(stdClass))
#2 /home/aaronw/www/mahara/htdocs/lib/tests/phpunit/bootstrap.php(34): UnitTestBootstrap->install_mahara()
#3 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php(92): include_once('/home/aaronw/ww...')
#4 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php(76): PHPUnit_Util_Fileloader::load('/home/aaronw/ww...')
#5 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(778): PHPUnit_Util_Fileloader::checkAndLoad('/home/aaronw/ww...')
#6 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(606): PHPUnit_TextUI_Command->handleBootstrap('/home/aaro in /home/aaronw/www/mahara/htdocs/lib/ddl.php on line 754
make: *** [phpunit] Error 255

Postgres:

[INF] ff (lib/phpunit.php:159) Installing blocktype.blog/taggedposts
[DBG] ff (lib/dml.php:150) postgres8 error: [-5: ERROR:  relation "tst_blocktype_taggedposts_tags" already exists] in adodb_throw(CREATE TABLE tst_blocktype_taggedposts_tags (
[DBG] ff (lib/dml.php:150)     id BIGSERIAL,
[DBG] ff (lib/dml.php:150)     block_instance BIGINT NOT NULL,
[DBG] ff (lib/dml.php:150)     tag VARCHAR(128) NOT NULL,
[DBG] ff (lib/dml.php:150)     tagtype BIGINT NOT NULL,
[DBG] ff (lib/dml.php:150) CONSTRAINT tst_bloctaggtags_id_pk PRIMARY KEY (id)
[DBG] ff (lib/dml.php:150) ), )
[DBG] ff (lib/dml.php:150) Command was: CREATE TABLE tst_blocktype_taggedposts_tags (
[DBG] ff (lib/dml.php:150)     id BIGSERIAL,
[DBG] ff (lib/dml.php:150)     block_instance BIGINT NOT NULL,
[DBG] ff (lib/dml.php:150)     tag VARCHAR(128) NOT NULL,
[DBG] ff (lib/dml.php:150)     tagtype BIGINT NOT NULL,
[DBG] ff (lib/dml.php:150) CONSTRAINT tst_bloctaggtags_id_pk PRIMARY KEY (id)
[DBG] ff (lib/dml.php:150) )
[DBG] ff (lib/ddl.php:753) Array
[DBG] ff (lib/ddl.php:753) (
[DBG] ff (lib/ddl.php:753)     [0] => CREATE TABLE tst_blocktype_taggedposts_tags (
[DBG] ff (lib/ddl.php:753)     id BIGSERIAL,
[DBG] ff (lib/ddl.php:753)     block_instance BIGINT NOT NULL,
[DBG] ff (lib/ddl.php:753)     tag VARCHAR(128) NOT NULL,
[DBG] ff (lib/ddl.php:753)     tagtype BIGINT NOT NULL,
[DBG] ff (lib/ddl.php:753) CONSTRAINT tst_bloctaggtags_id_pk PRIMARY KEY (id)
[DBG] ff (lib/ddl.php:753) )
[DBG] ff (lib/ddl.php:753) )
[DBG] ff (lib/ddl.php:753) 
PHP Fatal error:  Uncaught exception 'SQLException' with message 'Failed to install (check logs for xmldb errors)' in /home/aaronw/www/mahara/htdocs/lib/ddl.php:754
Stack trace:
#0 /home/aaronw/www/mahara/htdocs/lib/upgrade.php(429): install_from_xmldb_file('/home/aaronw/ww...')
#1 /home/aaronw/www/mahara/htdocs/lib/phpunit.php(173): upgrade_plugin(Object(stdClass))
#2 /home/aaronw/www/mahara/htdocs/lib/tests/phpunit/bootstrap.php(34): UnitTestBootstrap->install_mahara()
#3 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php(92): include_once('/home/aaronw/ww...')
#4 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php(76): PHPUnit_Util_Fileloader::load('/home/aaronw/ww...')
#5 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(778): PHPUnit_Util_Fileloader::checkAndLoad('/home/aaronw/ww...')
#6 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(606): PHPUnit_TextUI_Command->handleBootstrap('/home/aaro in /home/aaronw/www/mahara/htdocs/lib/ddl.php on line 754

Fatal error: Uncaught exception 'SQLException' with message 'Failed to install (check logs for xmldb errors)' in /home/aaronw/www/mahara/htdocs/lib/ddl.php:754
Stack trace:
#0 /home/aaronw/www/mahara/htdocs/lib/upgrade.php(429): install_from_xmldb_file('/home/aaronw/ww...')
#1 /home/aaronw/www/mahara/htdocs/lib/phpunit.php(173): upgrade_plugin(Object(stdClass))
#2 /home/aaronw/www/mahara/htdocs/lib/tests/phpunit/bootstrap.php(34): UnitTestBootstrap->install_mahara()
#3 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php(92): include_once('/home/aaronw/ww...')
#4 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php(76): PHPUnit_Util_Fileloader::load('/home/aaronw/ww...')
#5 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(778): PHPUnit_Util_Fileloader::checkAndLoad('/home/aaronw/ww...')
#6 /home/aaronw/www/mahara/external/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(606): PHPUnit_TextUI_Command->handleBootstrap('/home/aaro in /home/aaronw/www/mahara/htdocs/lib/ddl.php on line 754
make: *** [phpunit] Error 255

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1515794

Title:
  phpunit database teardown is incomplete

Status in Mahara:
  Confirmed

Bug description:
  As noticed in Bug 1515473.

  If you run the Mahara phpunit tests twice against the same database
  (by doing "make phpunit") you get errors on the second run. Phpunit
  attempts to tear down the test database and re-create it, but it
  misses some items and errors out when it tries to recreate them,
  because they already exist. This happens in Postgres or MySQL.

  I'm guessing it's because there are some database entities that we
  create through direct execution of DDL statements rather than through
  XMLDB and install.xml files. Probably the teardown uses the
  install.xml files to remove everything, misses the directly-created
  things, and then the subsequent installer tries to re-create them.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1515794/+subscriptions


References