Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-91439

Settings::sync() doesn't always work on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2
    • Core: I/O
    • None
    • macOS

    Description

      We are using QSettings in our tests to setup Qbs parameters.
      The pattern we use is the following:
      1. Create QSettings object
      2. Write some data into it
      3. Call sync()
      4. Run Qbs (which should read those settings)
      5. Remove previously written settings (via dtor of the helper object)
      6. Destroy QSetting object

      Here are some examples of this pattern: one, two, three

      However, it appears that external process (qbs) launched after call to sync() does not get the settings written into the config: one, two, three. It almost looks like a data race like sync() was not called at all.

      This only happens on macOS hosts on Github. It also appears that QSettings does not report any error - I've added a check and the tests fails, while sync() appears to be successful. I cannot reproduce that locally.

      I am not sure if this is a QSettings bug or an issue with GitHub VMs. However, it happens too often to simply ignore the issue (though it works as expected on Linux and Windows and most of the time on macOS) and I am a bit out of ideas how to proceed further.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            arch Ivan Komissarov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes