Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63855 Tasks and issues related to flaky tests
  3. QTBUG-63986

cleanup tests [qtbase]: redudant calls to QCoreApplication::proccesEvents()

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Testing: qtestlib
    • None

    Description

      Occurrences of QCoreApplication::processEvents() before QTRY_VERIFY and QTRY_COMPARE are not needed as those macros already spin an event loop, by calling QCoreApplication::processEvents(). The same is true for QTest::qWaitFor{Exposed,Active}(). Possibly there are other similar redundant misuses - cleanup those as well and document good practice to avoid these anti-patterns (see QTBUG-63987).

      For easier reviews this should be done in smaller logical chunks - subdirectories /widgets VS /gui VS each tst_* file separately?

      With qtbase at 5e71f40a348d71f06e8f48cc0dc0c08b4e2a33e9:

      grep -r "processEvents(" qtbase/tests/auto | wc -l
      1245
      

      We should also list common places where it is needed to use proccesEvents(), for example in certain cases after directly using QWindowSystemInterface API.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            paeglis Gatis Paeglis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes