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

Android: QTRY_VERIFY_WITH_TIMEOUT issue.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Fixed
    • Affects Version/s: 6.3
    • Fix Version/s: 6.4
    • Component/s: Multimedia
    • Labels:
      None
    • Platform/s:
      Android
    • Sprint:
      2022wk20FOAndroid&Automotive, 2022wk22FOQtforAndroid, 2022wk24FOQtforAndroid

      Description

      I tried to use TRY_VERIFY_WITH_TIMEOUT on the tst_QAudioDecoderBackend test, but it freeze the test for a long time.

      *****
       (QTRY_VERIFY_WITH_TIMEOUT(d.isDecoding(), 10000);
       FAIL! : tst_QAudioDecoderBackend::deviceTest() 'd.isDecoding()' returned FALSE
       Totals: 5 passed, 2 failed, 0 skipped, 0 blacklisted, 61845ms <-- HOX TIME
       *****
       (QTRY_VERIFY_WITH_TIMEOUT(d.isDecoding(), 20000);
       FAIL! : tst_QAudioDecoderBackend::deviceTest() 'd.isDecoding()' returned FALSE.
       Totals: 5 passed, 2 failed, 0 skipped, 0 blacklisted, 123073ms <-- HOX TIME
       *****
       (QTRY_VERIFY_WITH_TIMEOUT(d.isDecoding(), 30000);
       FAIL! : tst_QAudioDecoderBackend::deviceTest() 'd.isDecoding()' returned FALSE
       Totals: 5 passed, 2 failed, 0 skipped, 0 blacklisted, 184270ms <-- HOX TIME
      *****
       (QTRY_VERIFY_WITH_TIMEOUT(d.isDecoding(), 40000);
       FAIL! : tst_QAudioDecoderBackend::deviceTest() 'd.isDecoding()' returned FALSE
       Totals: 5 passed, 2 failed, 0 skipped, 0 blacklisted, 245501ms <-- HOX TIME
       *****
      

      Delay with do{} while()

      int times = 0; 
       do
      
      {       QTime dieTime= QTime::currentTime().addMSecs(5);      while (QTime::currentTime() < dieTime)          QCoreApplication::processEvents(QEventLoop::AllEvents, 100);      times++; }
      
      while (recorder.recorderState() == QMediaRecorder::RecordingState && times < 10);
      
      Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 729ms <-- HOX TIME
       * 
       ** 
       *** 
       **** 
       ***** 
       ****** 
       ******* 
       ******** 
       ********* 
       ********** 
       *********** 
       ************ 
       ************* 
       ************** 
       *************** 
       **************** 
       ***************** 
       ****************** Debug Prints *****************************
      
      With QTRY_VERIFY_WITH_TIMEOUT(d.isDecoding(), 20000);
      
       
      
      1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:04:52.682")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:04:52.683")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:04:52.683")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ___________emit setIsDecoding(true);_______
       1: QWARN : tst_QAudioDecoderBackend::fileTest() : dequeueOutputBuffer() status: outputFormat changed
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: running :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: m_isDecoding :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: TIME :: QTime("08:04:52.724")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::finished()
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: running :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: m_isDecoding :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: TIME :: QTime("08:04:52.725")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:04:52.735")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:04:52.785")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:04:52.836")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
      

       

       

      With do{} while()

       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.148")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.153")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.158")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ___________emit setIsDecoding(true);_______
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: running :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: m_isDecoding :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: TIME :: QTime("08:11:41.160")
       1: QWARN : tst_QAudioDecoderBackend::fileTest() : dequeueOutputBuffer() status: outputFormat changed
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.163")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.163")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.163")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.163")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.163")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::finished()
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: running :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: m_isDecoding :: true
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: void QPlatformAudioDecoder::setIsDecoding(bool) :: TIME :: QTime("08:11:41.174")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.214")
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: false
       1: QDEBUG : tst_QAudioDecoderBackend::fileTest() ____: bool QAudioDecoder::isDecoding() const :: TIME :: QTime("08:11:41.214")
      

      I think that QTRY_VERIFY_WITH_TIMEOUT works differently with a QThread.

      QAndroidAudioDecoder use a QThread for the Decoder.

      Reference
      https://codereview.qt-project.org/c/qt/qtmultimedia/+/396739

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              pekkagehor Pekka Gehör
              Reporter:
              pekkagehor Pekka Gehör
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes