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

qtestlib watchdog timeout should be runtime-configurable

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Testing: qtestlib
    • None

    Description

      Every test must finish within the watchdog timeout, which is set to 5 minutes, or the value of the env var QTEST_FUNCTION_TIMEOUT in milliseconds, as seen in qtestcase.cpp:

      static std::chrono::milliseconds defaultTimeout()
      {
          if (timeout == -1) {
              bool ok = false;
              timeout = qEnvironmentVariableIntValue("QTEST_FUNCTION_TIMEOUT", &ok);
      
              if (!ok || timeout <= 0)
                  timeout = 5*60*1000;
          }
          return std::chrono::milliseconds{timeout};
      }
      

      There are valid reasons to decide the timeout in runtime, for example if we know that under certain conditions the specific test runs too slow. This could be done by calling a static timer in initMain() or initTestCase() before any testcases have been executed.

      Attachments

        Issue Links

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

          Activity

            People

              macadder Jason McDonald
              jimis Dimitrios Apostolou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes