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

Table sequences are not reset before scenario in MySQL 5.6.0-5.6.15

XMLWordPrintable

    • MySQL
    • MOODLE_26_STABLE
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • w12_MDL-44191_m27_mysql56
    • Hide

      1/ execute unit tests with MySQL 5.5.x
      2/ execute unit tests with MySQL 5.6.15 or lower (expected one failure on sequence reset)
      3/ execute unit tests with MySQL 5.6.16 (17 and 18 not released yet)
      4/ master only with MDL-43604: optionally execute with MariaDB 10.0.9RC (expected one failure on sequence reset)

      Show
      1/ execute unit tests with MySQL 5.5.x 2/ execute unit tests with MySQL 5.6.15 or lower (expected one failure on sequence reset) 3/ execute unit tests with MySQL 5.6.16 (17 and 18 not released yet) 4/ master only with MDL-43604 : optionally execute with MariaDB 10.0.9RC (expected one failure on sequence reset)

      When running a behat acceptance test it resets the database before each scenario at which point it is supposed to reset table sequences as needed. For empty tables it should reset the sequence to 1. This is important where element names are contain record ids for uniqueness and then features can work only if the record id remains the same for each run and that requires that the sequence will be reset.

      With mysql, testing_util::reset_all_database_sequences calls for empty tables:

      $DB->change_database_structure("ALTER TABLE {$prefix}{$table} AUTO_INCREMENT = 1");

      But this query does not affect the sequence, not even when submitted directly via phpmyadmin.

      A query that does work is "TRUNCATE TABLE {$prefix}{$table}".

      Moodle behat api should probably provide a method to cleanup certain components/areas in the feature background, as failed tests may leave records in that database that will prevent sequence reset.

            skodak Petr Skoda
            itamart Itamar Tzadok
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Marina Glancy Marina Glancy
            Rajesh Taneja Rajesh Taneja
            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.