Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-4110

Encrypted provenance repository test can fail due to timing

    XMLWordPrintableJSON

    Details

      Description

      There is an occasional failure in the unit tests for the EncryptedWriteAheadProvenanceRepository where the events retrieved (9) are less than the expected number (10) because it has not yet indexed the last event. Adding a Thread.sleep(1000) seems to resolve this consistently.

      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running org.apache.nifi.provenance.EncryptedSchemaRecordReaderWriterTest
      Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.473 sec - in org.apache.nifi.provenance.EncryptedSchemaRecordReaderWriterTest
      Running org.apache.nifi.provenance.EncryptedWriteAheadProvenanceRepositoryTest
      Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.161 sec <<< FAILURE! - in org.apache.nifi.provenance.EncryptedWriteAheadProvenanceRepositoryTest
      testWriteAheadProvenanceRepositoryShouldRegisterAndRetrieveEvents(org.apache.nifi.provenance.EncryptedWriteAheadProvenanceRepositoryTest)  Time elapsed: 0.033 sec  <<< FAILURE!
      org.codehaus.groovy.runtime.powerassert.PowerAssertionError: assert recoveredRecords.size() == RECORD_COUNT
             |                |      |  |
             |                9      |  10
             |                       false
             [ProvenanceEventRecord [eventId=0, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null], ProvenanceEventRecord [eventId=1, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null], ProvenanceEventRecord [eventId=2, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null], ProvenanceEventRecord [eventId=3, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null], ProvenanceEventRecord [eventId=4, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null], ProvenanceEventRecord [eventId=5, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null], ProvenanceEventRecord [eventId=6, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null], ProvenanceEventRecord [eventId=7, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null], ProvenanceEventRecord [eventId=9, eventType=RECEIVE, eventTime=Thu Jun 22 11:09:07 EDT 2017, uuid=2c2f9e5e-ebda-4ac1-a954-4b1d0d9ddd1f, fileSize=0, componentId=1234, transitUri=nifi://unit-test, sourceSystemFlowFileIdentifier=null, parentUuids=[], alternateIdentifierUri=null]]
      	at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:402)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:650)
      	at org.apache.nifi.provenance.EncryptedWriteAheadProvenanceRepositoryTest.testWriteAheadProvenanceRepositoryShouldRegisterAndRetrieveEvents(EncryptedWriteAheadProvenanceRepositoryTest.groovy:237)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alopresto Andy LoPresto
                Reporter:
                alopresto Andy LoPresto
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: