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

rpl.rpl_mdev12179 windows fix "File already exists"

Details

    Description

      https://buildbot.mariadb.org/#/builders/239/builds/22373/steps/11/logs/stdio

      rpl.rpl_mdev12179 'mix'                  w20 [ fail ]
              Test ended at 2024-07-10 23:15:17
      CURRENT_TEST: rpl.rpl_mdev12179
      mysqltest: At line 97: File already exist: 'D:/Buildbot/amd64-windows-packages/build/mysql-test/var/20/tmp/mysqld.2.expect'
      

      or

      CURRENT_TEST: rpl.rpl_mdev12179
      mysqltest: At line 275: File already exist: 'D:/Buildbot/amd64-windows-packages/build/mysql-test/var/11/tmp/mysqld.2.expect'
      

      Same thing. Windows expecting files to be removed, and other OS will overrite file.

      As its a race condition, a remove_file before will work if prefixed with error 0,1 but I suspect there's a better way.

      Attachments

        Activity

          wlad Vladislav Vaintroub added a comment - - edited

          Can you be more specific, since you did some research already.
          I do not even know what those expects are for.
          What do other systems do? Can you point to the code?

          Why it only happens in rpl tests that never ever ran on Windows as long as I remember, in mariadb?

          wlad Vladislav Vaintroub added a comment - - edited Can you be more specific, since you did some research already. I do not even know what those expects are for. What do other systems do? Can you point to the code? Why it only happens in rpl tests that never ever ran on Windows as long as I remember, in mariadb?
          wlad Vladislav Vaintroub added a comment - - edited

          Apparently, blaming Windows here is incorrect. It does what it needs to do.

          The mtr command is write_file
          which has that, in do_write_file_command in mysqltest.cc

            if (!append && access(ds_filename.str, F_OK) == 0)
            {
              /* The file should not be overwritten */
              die("File already exist: '%s'", ds_filename.str);
            }
          

          for which I hope, access() also works outside of Windows.
          Why the file was there, I've no idea. mtr did not cleanup something after previous error, no clue.

          wlad Vladislav Vaintroub added a comment - - edited Apparently, blaming Windows here is incorrect. It does what it needs to do. The mtr command is write_file which has that, in do_write_file_command in mysqltest.cc if (!append && access(ds_filename.str, F_OK) == 0) { /* The file should not be overwritten */ die( "File already exist: '%s'" , ds_filename.str); } for which I hope, access() also works outside of Windows. Why the file was there, I've no idea. mtr did not cleanup something after previous error, no clue.
          danblack Daniel Black added a comment -

          expects where controlling the server restart.

          I suspect other OS overwrite the file without error. There's a deleting somewhere.

          Doing a lazy simplification compared to what other tests to with a expect file.

          https://github.com/MariaDB/server/pull/3394

          May not be right, but I'll see what CI processes it as tomorrow.

          danblack Daniel Black added a comment - expects where controlling the server restart. I suspect other OS overwrite the file without error. There's a deleting somewhere. Doing a lazy simplification compared to what other tests to with a expect file. https://github.com/MariaDB/server/pull/3394 May not be right, but I'll see what CI processes it as tomorrow.

          People

            danblack Daniel Black
            danblack Daniel Black
            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.