Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-6284

Flaky test UpgradeIT.testConcurrentUpgradeThrowsUpgradeInProgressException

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0.0, 4.15.0
    • 5.1.0, 4.16.0
    • None
    • None

    Description

      UpgradeIT.testConcurrentUpgradeThrowsUpgradeInProgressException is sometimes failing with error logs:

      e.g https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/166/testReport/org.apache.phoenix.end2end/UpgradeIT/MatrixBuild___Matrix___HBASE_PROFILE____2_1____BuildAndTest___testConcurrentUpgradeThrowsUprgadeInProgressException/

      java.lang.AssertionError: One and only one thread should have acquired the mutex . Actual: true
      	at org.junit.Assert.fail(Assert.java:89)
      	at org.junit.Assert.failEquals(Assert.java:187)
      	at org.junit.Assert.assertNotEquals(Assert.java:163)
      	at org.apache.phoenix.end2end.UpgradeIT.testConcurrentUpgradeThrowsUprgadeInProgressException(UpgradeIT.java:237)
      

      While testing if 2 threads can simultaneously acquire lock, we release the lock immediately in finally for individual thread if it had acquired the mutex. This can lead to failure if one of the threads starts executing (due to slowness) only after the other thread releases mutex cell. In that case, the sequence of mutex acquisition would be:

      Thread1 acquires -> Thread1 releases -> Thread2 acquires -> Thread2 releases

      Because of this sequence, the above mentioned AssertionError can occur.

      Attachments

        Activity

          People

            vjasani Viraj Jasani
            vjasani Viraj Jasani
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: