Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-52799

Problem on 1st phpunit runs using mariadb (possibly others too)

XMLWordPrintable

    • MOODLE_31_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • wip-mdl-52799
    • Hide
      create & start mariadbd 10.0.0 cocker instance
      1. Copy attached Dockerfile to a dome folder and run below command within the directory.

        docker build -t mymariadb:10.1 .

      2. Start docker image

        docker run -p 3309:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=moodle -e MYSQL_DATABASE=moodle -e MYSQL_USER=moodle -e MYSQL_PASSWORD=moodle -d mymariadb:10.1 --innodb_file_per_table=1 --innodb_file_format=Barracuda
        

      Run phpunit
      1. Update config.php with
        • dbhost = localhost
        • dbuser = moodle
        • dbpass = moodle
        • dbport = 3309
        • dbtype = mariadb
      2. Initialise phpunit

         php admin/tool/phpunit/cli/init.php

      3. Run phpunit

         vendor/bin/phpunit

      Show
      create & start mariadbd 10.0.0 cocker instance Copy attached Dockerfile to a dome folder and run below command within the directory. docker build -t mymariadb:10.1 . Start docker image docker run -p 3309:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=moodle -e MYSQL_DATABASE=moodle -e MYSQL_USER=moodle -e MYSQL_PASSWORD=moodle -d mymariadb:10.1 --innodb_file_per_table=1 --innodb_file_format=Barracuda Run phpunit Update config.php with dbhost = localhost dbuser = moodle dbpass = moodle dbport = 3309 dbtype = mariadb Initialise phpunit php admin/tool/phpunit/cli/init.php Run phpunit vendor/bin/phpunit

      Maybe a regression of MDL-52060, maybe not...

      ... today I've been installing a number of (docker, I assume the same happens with normal instances) mariadb phpunit databases... and consistently, the first run always failed this test:

      1) core_phpunit_advanced_testcase::test_database_reset
      Failed asserting that 141000 matches expected 1.
       
      /Users/stronk7/git_moodle/testing/lib/phpunit/tests/advanced_test.php:178
      /Users/stronk7/git_moodle/testing/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit core_phpunit_advanced_testcase lib/phpunit/tests/advanced_test.php
      

      Only happens the first run. Running it again passes ok.

      Steps to reproduce:

      $ docker run -p 3307:3306 --name mariadb101 -e MYSQL_ROOT_PASSWORD=xxxxxx -e MYSQL_DATABASE=moodle -e MYSQL_USER=xxxxxx -e MYSQL_PASSWORD=xxxxxx -d mariadb:10.1 --innodb_file_per_table=1 --innodb_file_format=Barracuda
      ...
      ...
      431ade13646f8c56c003232c41633f1279ca020103be2e6dbab4db71a24c7c06
       
      $ php admin/tool/phpunit/cli/init.php
      ...
      ...
      PHPUnit test environment setup complete.
       
      $ vendor/bin/phpunit (fails)
      ....F
       
      $ vendor/bin/phpunit (passes)
      .............................................................
       
      $ docker stop mariadb101
      mariadb101
       
      $ docker rm mariadb101
      mariadb101
      

      Have been trying to find a similar issue, but have failed to do so. Not sure if that's known issue. Haven't tried with other databases either.

      Ciao

            rajeshtaneja Rajesh Taneja
            stronk7 Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            cameron1729 cameron1729
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.