Moodle
  1. Moodle
  2. MDL-23286

Running all of the tests in lib/grade/simpletest results in a timeout

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      956

      Description

      If you run all of the tests in lib/grade/simpletest it times out with the following. Probably need to combine multiple tests into one test as each test involves dropping the test tables, re-adding them and repopulating them with test data. testgradeitem.php for example has 35 tests so the tables are added and dropped 35 times.

      This table grade_categories already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.

      • line 552 of /lib/simpletestlib.php: call to debugging()
      • line 568 of /lib/simpletestlib.php: call to UnitTestCaseUsingDatabase->create_test_table()
      • line 80 of /lib/simpletest/fixtures/gradetest.php: call to UnitTestCaseUsingDatabase->create_test_tables()
      • line 67 of /lib/simpletestlib/invoker.php: call to grade_test->setUp()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleInvoker->invoke()
      • line 53 of /lib/simpletestlib/errors.php: call to SimpleInvokerDecorator->invoke()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleErrorTrappingInvoker->invoke()
      • line 43 of /lib/simpletestlib/exceptions.php: call to SimpleInvokerDecorator->invoke()
      • line 143 of /lib/simpletestlib/test_case.php: call to SimpleExceptionTrappingInvoker->invoke()
      • line 615 of /lib/simpletestlib/test_case.php: call to SimpleTestCase->run()
      • line 618 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      • line 37 of /admin/report/unittest/ex_simple_test.php: call to TestSuite->run()
      • line 142 of /lib/simpletestcoveragelib.php: call to AutoGroupTest->run()
      • line 91 of /admin/report/unittest/index.php: call to autogroup_test_coverage->run()

      This table grade_categories_history already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.

      • line 552 of /lib/simpletestlib.php: call to debugging()
      • line 568 of /lib/simpletestlib.php: call to UnitTestCaseUsingDatabase->create_test_table()
      • line 80 of /lib/simpletest/fixtures/gradetest.php: call to UnitTestCaseUsingDatabase->create_test_tables()
      • line 67 of /lib/simpletestlib/invoker.php: call to grade_test->setUp()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleInvoker->invoke()
      • line 53 of /lib/simpletestlib/errors.php: call to SimpleInvokerDecorator->invoke()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleErrorTrappingInvoker->invoke()
      • line 43 of /lib/simpletestlib/exceptions.php: call to SimpleInvokerDecorator->invoke()
      • line 143 of /lib/simpletestlib/test_case.php: call to SimpleExceptionTrappingInvoker->invoke()
      • line 615 of /lib/simpletestlib/test_case.php: call to SimpleTestCase->run()
      • line 618 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      • line 37 of /admin/report/unittest/ex_simple_test.php: call to TestSuite->run()
      • line 142 of /lib/simpletestcoveragelib.php: call to AutoGroupTest->run()
      • line 91 of /admin/report/unittest/index.php: call to autogroup_test_coverage->run()

      This table scale already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.

      • line 552 of /lib/simpletestlib.php: call to debugging()
      • line 568 of /lib/simpletestlib.php: call to UnitTestCaseUsingDatabase->create_test_table()
      • line 80 of /lib/simpletest/fixtures/gradetest.php: call to UnitTestCaseUsingDatabase->create_test_tables()
      • line 67 of /lib/simpletestlib/invoker.php: call to grade_test->setUp()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleInvoker->invoke()
      • line 53 of /lib/simpletestlib/errors.php: call to SimpleInvokerDecorator->invoke()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleErrorTrappingInvoker->invoke()
      • line 43 of /lib/simpletestlib/exceptions.php: call to SimpleInvokerDecorator->invoke()
      • line 143 of /lib/simpletestlib/test_case.php: call to SimpleExceptionTrappingInvoker->invoke()
      • line 615 of /lib/simpletestlib/test_case.php: call to SimpleTestCase->run()
      • line 618 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      • line 37 of /admin/report/unittest/ex_simple_test.php: call to TestSuite->run()
      • line 142 of /lib/simpletestcoveragelib.php: call to AutoGroupTest->run()
      • line 91 of /admin/report/unittest/index.php: call to autogroup_test_coverage->run()

      This table scale_history already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.

      • line 552 of /lib/simpletestlib.php: call to debugging()
      • line 568 of /lib/simpletestlib.php: call to UnitTestCaseUsingDatabase->create_test_table()
      • line 80 of /lib/simpletest/fixtures/gradetest.php: call to UnitTestCaseUsingDatabase->create_test_tables()
      • line 67 of /lib/simpletestlib/invoker.php: call to grade_test->setUp()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleInvoker->invoke()
      • line 53 of /lib/simpletestlib/errors.php: call to SimpleInvokerDecorator->invoke()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleErrorTrappingInvoker->invoke()
      • line 43 of /lib/simpletestlib/exceptions.php: call to SimpleInvokerDecorator->invoke()
      • line 143 of /lib/simpletestlib/test_case.php: call to SimpleExceptionTrappingInvoker->invoke()
      • line 615 of /lib/simpletestlib/test_case.php: call to SimpleTestCase->run()
      • line 618 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      • line 37 of /admin/report/unittest/ex_simple_test.php: call to TestSuite->run()
      • line 142 of /lib/simpletestcoveragelib.php: call to AutoGroupTest->run()
      • line 91 of /admin/report/unittest/index.php: call to autogroup_test_coverage->run()

      This table grade_items already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.

      • line 552 of /lib/simpletestlib.php: call to debugging()
      • line 568 of /lib/simpletestlib.php: call to UnitTestCaseUsingDatabase->create_test_table()
      • line 80 of /lib/simpletest/fixtures/gradetest.php: call to UnitTestCaseUsingDatabase->create_test_tables()
      • line 67 of /lib/simpletestlib/invoker.php: call to grade_test->setUp()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleInvoker->invoke()
      • line 53 of /lib/simpletestlib/errors.php: call to SimpleInvokerDecorator->invoke()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleErrorTrappingInvoker->invoke()
      • line 43 of /lib/simpletestlib/exceptions.php: call to SimpleInvokerDecorator->invoke()
      • line 143 of /lib/simpletestlib/test_case.php: call to SimpleExceptionTrappingInvoker->invoke()
      • line 615 of /lib/simpletestlib/test_case.php: call to SimpleTestCase->run()
      • line 618 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      • line 37 of /admin/report/unittest/ex_simple_test.php: call to TestSuite->run()
      • line 142 of /lib/simpletestcoveragelib.php: call to AutoGroupTest->run()
      • line 91 of /admin/report/unittest/index.php: call to autogroup_test_coverage->run()

      This table grade_items_history already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.

      • line 552 of /lib/simpletestlib.php: call to debugging()
      • line 568 of /lib/simpletestlib.php: call to UnitTestCaseUsingDatabase->create_test_table()
      • line 80 of /lib/simpletest/fixtures/gradetest.php: call to UnitTestCaseUsingDatabase->create_test_tables()
      • line 67 of /lib/simpletestlib/invoker.php: call to grade_test->setUp()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleInvoker->invoke()
      • line 53 of /lib/simpletestlib/errors.php: call to SimpleInvokerDecorator->invoke()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleErrorTrappingInvoker->invoke()
      • line 43 of /lib/simpletestlib/exceptions.php: call to SimpleInvokerDecorator->invoke()
      • line 143 of /lib/simpletestlib/test_case.php: call to SimpleExceptionTrappingInvoker->invoke()
      • line 615 of /lib/simpletestlib/test_case.php: call to SimpleTestCase->run()
      • line 618 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      • line 37 of /admin/report/unittest/ex_simple_test.php: call to TestSuite->run()
      • line 142 of /lib/simpletestcoveragelib.php: call to AutoGroupTest->run()
      • line 91 of /admin/report/unittest/index.php: call to autogroup_test_coverage->run()

      This table grade_grades already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.

      • line 552 of /lib/simpletestlib.php: call to debugging()
      • line 568 of /lib/simpletestlib.php: call to UnitTestCaseUsingDatabase->create_test_table()
      • line 80 of /lib/simpletest/fixtures/gradetest.php: call to UnitTestCaseUsingDatabase->create_test_tables()
      • line 67 of /lib/simpletestlib/invoker.php: call to grade_test->setUp()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleInvoker->invoke()
      • line 53 of /lib/simpletestlib/errors.php: call to SimpleInvokerDecorator->invoke()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleErrorTrappingInvoker->invoke()
      • line 43 of /lib/simpletestlib/exceptions.php: call to SimpleInvokerDecorator->invoke()
      • line 143 of /lib/simpletestlib/test_case.php: call to SimpleExceptionTrappingInvoker->invoke()
      • line 615 of /lib/simpletestlib/test_case.php: call to SimpleTestCase->run()
      • line 618 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      • line 37 of /admin/report/unittest/ex_simple_test.php: call to TestSuite->run()
      • line 142 of /lib/simpletestcoveragelib.php: call to AutoGroupTest->run()
      • line 91 of /admin/report/unittest/index.php: call to autogroup_test_coverage->run()

      This table grade_grades_history already exists from a previous execution. If the error persists you will need to review your code to ensure it is being created only once.

      • line 552 of /lib/simpletestlib.php: call to debugging()
      • line 568 of /lib/simpletestlib.php: call to UnitTestCaseUsingDatabase->create_test_table()
      • line 80 of /lib/simpletest/fixtures/gradetest.php: call to UnitTestCaseUsingDatabase->create_test_tables()
      • line 67 of /lib/simpletestlib/invoker.php: call to grade_test->setUp()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleInvoker->invoke()
      • line 53 of /lib/simpletestlib/errors.php: call to SimpleInvokerDecorator->invoke()
      • line 137 of /lib/simpletestlib/invoker.php: call to SimpleErrorTrappingInvoker->invoke()
      • line 43 of /lib/simpletestlib/exceptions.php: call to SimpleInvokerDecorator->invoke()
      • line 143 of /lib/simpletestlib/test_case.php: call to SimpleExceptionTrappingInvoker->invoke()
      • line 615 of /lib/simpletestlib/test_case.php: call to SimpleTestCase->run()
      • line 618 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      • line 37 of /admin/report/unittest/ex_simple_test.php: call to TestSuite->run()
      • line 142 of /lib/simpletestcoveragelib.php: call to AutoGroupTest->run()
      • line 91 of /admin/report/unittest/index.php: call to autogroup_test_coverage->run()

      ( ! ) Fatal error: Maximum execution time of 300 seconds exceeded in /home/andrew/Desktop/repos/moodle/lib/ddl/sql_generator.php on line 973
      Call Stack

      1. Time Memory Function Location
        1 0.0005 165544 {main}( ) ../index.php:0
        2 0.8274 90020856 autogroup_test_coverage->run( ) ../index.php:91
        3 0.8274 90021128 AutoGroupTest->run( ) ../simpletestcoveragelib.php:142
        4 0.8274 90021584 TestSuite->run( ) ../ex_simple_test.php:37
        5 254.9619 98802128 TestSuite->run( ) ../test_case.php:618
        6 254.9624 98818440 SimpleTestCase->run( ) ../test_case.php:615
        7 708.6469 99702648 SimpleExceptionTrappingInvoker->invoke( ) ../test_case.php:143
        8 708.6469 99703488 SimpleInvokerDecorator->invoke( ) ../exceptions.php:43
        9 708.6469 99703616 SimpleErrorTrappingInvoker->invoke( ) ../invoker.php:137
        10 708.6469 99704144 SimpleInvokerDecorator->invoke( ) ../errors.php:53
        11 708.6469 99704272 SimpleInvoker->invoke( ) ../invoker.php:137
        12 708.6469 99704472 grade_test->setUp( ) ../invoker.php:67
        13 708.6469 99705672 UnitTestCaseUsingDatabase->create_test_tables( ) ../gradetest.php:80
        14 715.9653 99717600 UnitTestCaseUsingDatabase->create_test_table( ) ../simpletestlib.php:568
        15 715.9729 99720272 database_manager->install_one_table_from_xmldb_file( ) ../simpletestlib.php:555
        16 715.9735 99724968 database_manager->install_from_xmldb_structure( ) ../database_manager.php:439
        17 715.9735 99725104 sql_generator->getCreateStructureSQL( ) ../database_manager.php:451
        18 715.9735 99726352 sql_generator->getCreateTableSQL( ) ../sql_generator.php:193
        19 716.9447 99737168 sql_generator->getCreateIndexSQL( ) ../sql_generator.php:333
        20 716.9447 99738840 sql_generator->getNameForObject( ) ../sql_generator.php:372
        21 717.2492 100418464 in_array ( ) ../sql_generator.php:973

        ( ! ) Fatal error: Call to a member function query() on a non-object in /home/andrew/Desktop/repos/moodle/lib/dml/mysqli_native_moodle_database.php on line 245
        Call Stack
        # Time Memory Function Location
        1 0.0005 165544 {main}

        ( ) ../index.php:0
        2 0.8274 90020856 autogroup_test_coverage->run( ) ../index.php:91
        3 0.8274 90021128 AutoGroupTest->run( ) ../simpletestcoveragelib.php:142
        4 0.8274 90021584 TestSuite->run( ) ../ex_simple_test.php:37
        5 254.9619 98802128 TestSuite->run( ) ../test_case.php:618
        6 254.9624 98818440 SimpleTestCase->run( ) ../test_case.php:615
        7 708.6469 99702648 SimpleExceptionTrappingInvoker->invoke( ) ../test_case.php:143
        8 708.6469 99703488 SimpleInvokerDecorator->invoke( ) ../exceptions.php:43
        9 708.6469 99703616 SimpleErrorTrappingInvoker->invoke( ) ../invoker.php:137
        10 708.6469 99704144 SimpleInvokerDecorator->invoke( ) ../errors.php:53
        11 708.6469 99704272 SimpleInvoker->invoke( ) ../invoker.php:137
        12 708.6469 99704472 grade_test->setUp( ) ../invoker.php:67
        13 708.6469 99705672 UnitTestCaseUsingDatabase->create_test_tables( ) ../gradetest.php:80
        14 715.9653 99717600 UnitTestCaseUsingDatabase->create_test_table( ) ../simpletestlib.php:568
        15 715.9729 99720272 database_manager->install_one_table_from_xmldb_file( ) ../simpletestlib.php:555
        16 715.9735 99724968 database_manager->install_from_xmldb_structure( ) ../database_manager.php:439
        17 715.9735 99725104 sql_generator->getCreateStructureSQL( ) ../database_manager.php:451
        18 715.9735 99726352 sql_generator->getCreateTableSQL( ) ../sql_generator.php:193
        19 716.9447 99737168 sql_generator->getCreateIndexSQL( ) ../sql_generator.php:333
        20 716.9447 99738840 sql_generator->getNameForObject( ) ../sql_generator.php:372
        21 717.2492 100418464 in_array ( ) ../sql_generator.php:973
        22 717.3117 100387648 UnitTestCaseUsingDatabase->__destruct( ) ../simpletestlib.php:0
        23 717.3117 100387648 UnitTestCaseUsingDatabase->automatic_clean_up( ) ../simpletestlib.php:533
        24 717.3117 100388392 UnitTestCaseUsingDatabase->drop_test_table( ) ../simpletestlib.php:506
        25 717.3120 100463560 database_manager->drop_table( ) ../simpletestlib.php:583
        26 717.3120 100463696 database_manager->table_exists( ) ../database_manager.php:360
        27 717.3120 100463824 sql_generator->table_exists( ) ../database_manager.php:102
        28 717.3120 100464088 mysqli_native_moodle_database->get_tables( ) ../sql_generator.php:179

        Activity

          People

          • Assignee:
            Andrew Davis
            Reporter:
            Andrew Davis
            Tester:
            Nobody
            Participants:
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: