Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16474

PostCommit listener should be monitored like async listener

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.8.0-HF30, 6.0-HF05, 7.1
    • Fix Version/s: 5.8.0-HF31, 6.0-HF06, 7.2
    • Component/s: Core VCS

      Description

      When writing unit test there is a way to wait for asynchronous listener using WorkManager#awaitCompletion.

      This is reliable only if PostCommit synchronous listener does not timeout.

      Here is a case where it fails:

      main: commit
        postcommit1: start
      main: wait for postcommit1 for 300ms
      main: timeout 300ms, postcommit1 continue to run (now asynchronously)
      main: call awaitCompletion
      main: awaitCompletion returns
        postcommit1: commit and generate new async jobs
      main: get random results because there are async jobs running
      

      May be awaitCompletion should be extended to wait for PostCommit listener.

      Note that there is a warning when a post commit listener timeout, it should be taken as a bad smell indicator in unit test:

       WARN  [PostCommitEventExecutor] Events postcommit execution exceeded timeout of 300ms, leaving thread running
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.