Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-13043

Skipped tests ignore warning suppressions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
    • 10.1.25, 10.2.7, 10.3.1
    • Tests
    • None

    Description

      When a test is skipped in the middle, all warnings produced by it are considered shutdown-related.

      Consider a test case similar to this:

      set global log_warnings= 2;
      --error 1045
      --connect(con1,localhost,foo,,)
      set global log_warnings= DEFAULT;
      --echo # Finish
      

      Currently it would pass in any tree, because Access denied for user is suppressed globally in MTR; but if we remove that suppression, it would fail like this:

      set global log_warnings= 2;
      connect(localhost,foo,,test,16000,/data/bld/5.5/mysql-test/var/tmp/mysqld.1.sock);
      ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO)
      set global log_warnings= DEFAULT;
      # Finish
      bug.t1                                   [ fail ]  Found warnings/errors in server log file!
              Test ended at 2017-06-09 15:12:47
      line
      170609 15:12:47 [Warning] Access denied for user 'foo'@'localhost' (using password: NO)
      ^ Found warnings in /data/bld/5.5/mysql-test/var/log/mysqld.1.err
      ok
      

      It's just to imitate a warning not suppressed globally.

      Then to fix it, we would need to add a local suppression:

      set global log_warnings= 2;
      call mtr.add_suppression("Access denied for user");
      --error 1045
      --connect(con1,localhost,foo,,)
      set global log_warnings= DEFAULT;
      --echo # Finish
      

      Now it will work all right:

      worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      set global log_warnings= 2;
      call mtr.add_suppression("Access denied for user");
      connect(localhost,foo,,test,16000,/data/bld/5.5/mysql-test/var/tmp/mysqld.1.sock);
      ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO)
      set global log_warnings= DEFAULT;
      # Finish
      bug.t1                                   [ pass ]      6
      

      However, if the test skips itself in the middle, it doesn't work anymore:

      set global log_warnings= 2;
      call mtr.add_suppression("Access denied for user");
      --error 1045
      --connect(con1,localhost,foo,,)
      set global log_warnings= DEFAULT;
      --skip "Skipped"
      --echo # Finish
      

      set global log_warnings= 2;
      call mtr.add_suppression("Access denied for user");
      connect(localhost,foo,,test,16000,/data/bld/5.5/mysql-test/var/tmp/mysqld.1.sock);
      ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO)
      set global log_warnings= DEFAULT;
      bug.t1                                   [ skipped ]  "Skipped"
      ***Warnings generated in error logs during shutdown after running tests: bug.t1
       
      170609 15:15:57 [Warning] Access denied for user 'foo'@'localhost' (using password: NO)
      

      This is because when a test is skipped, MTR does not perform check_warnings upon the end of test case, and thus all warnings produced during its partial execution are only noticed and registered when the server shuts down.

      Attachments

        Activity

          People

            elenst Elena Stepanova
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.