Moodle
  1. Moodle
  2. MDL-32152

database connection problems while running unit tests

    Details

    • Affected Branches:
      MOODLE_23_STABLE

      Description

      discovered here

      there seems to be a problem with connection (even across separate installations) during unit tests.
      line in common is : line 616 of /lib/simpletestlib/test_case.php: call to UnitTestCaseUsingDatabase->__construct()

      pg:
      "Debug info:
      Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: sorry, too many clients already in /home/aparup/mcode/integration/lib/dml/pgsql_native_moodle_database.php on line 164
      Stack trace:
      line 175 of /lib/dml/pgsql_native_moodle_database.php: dml_connection_exception thrown
      line 659 of /admin/tool/unittest/simpletestlib.php: call to pgsql_native_moodle_database->connect()
      line 616 of /lib/simpletestlib/test_case.php: call to UnitTestCaseUsingDatabase->__construct()
      line 620 of /lib/simpletestlib/test_case.php: call to TestSuite->run()
      line 53 of /admin/tool/unittest/ex_simple_test.php: call to TestSuite->run()
      line 142 of /admin/tool/unittest/simpletestcoveragelib.php: call to AutoGroupTest->run()
      line 119 of /admin/tool/unittest/index.php: call to autogroup_test_coverage->run()
      "

      ora:
      "Debug info: ORA-12516: TNS:listener could not find available handler with matching protocol stack
      Stack trace:
      line 209 of \lib\dml\oci_native_moodle_database.php: dml_connection_exception thrown
      line 659 of \admin\tool\unittest\simpletestlib.php: call to oci_native_moodle_database->connect()
      line 616 of \lib\simpletestlib\test_case.php: call to UnitTestCaseUsingDatabase->__construct()
      line 620 of \lib\simpletestlib\test_case.php: call to TestSuite->run()
      line 53 of \admin\tool\unittest\ex_simple_test.php: call to TestSuite->run()
      line 142 of \admin\tool\unittest\simpletestcoveragelib.php: call to AutoGroupTest->run()
      line 119 of \admin\tool\unittest\index.php: call to autogroup_test_coverage->run()
      "

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Petr Skoda added a comment -

            Workaround should be to increase the connection limit, in any case SimpleTest will be obsolete soon - we already have functional tests under PHPUnit, the MDL-32323 includes all tests except completion lib, so I expect we will drop old functional tests soon.

            Thanks for the report anyway.

            Show
            Petr Skoda added a comment - Workaround should be to increase the connection limit, in any case SimpleTest will be obsolete soon - we already have functional tests under PHPUnit, the MDL-32323 includes all tests except completion lib, so I expect we will drop old functional tests soon. Thanks for the report anyway.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: