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

qtestlib watchdog timeout should be runtime-configurable

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes