Details

    • Type: New Feature
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: pipeline
    • Labels:
      None
    • Similar Issues:

      Description

      WatchYourStep (in test sources) is actually similar to something that has been requested: a way to wait until a named file appears in the workspace, or until the content of a file has changed, etc. All these things could be handled by a step like this:

      waitForCond {
          readFile 'flag'
      }
      

      or

      waitForCond {
          readFile('flag') == 'ready'
      }
      

      Roughly similar to retry, it would run its block, and if the block either throws an exception or returns false, it would run it again. Or it might be more intuitive to expect only a boolean return value and force the first example to be written as

      waitForCond {
          try {
              readFile 'flag'
              return true
          } catch (FileNotFoundException _) {
              return false
          }
      }
      

      (Even if an exception is permitted as a synonym for false, InterruptedException should be thrown up.)

      Unlike retry there would not need to be any limit to the number of retries, and there would be an exponentially increasing delay between successive retries: run the first time immediately, then retry after 100ms, then continue to multiply the delay by a factor of 1.3 or something like that (perhaps up to some maximum delay like DurableTaskStep has).

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Priority Minor [ 4 ] Major [ 3 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-26148 [ JENKINS-26148 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-26163 [ JENKINS-26163 ]
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-27127 [ JENKINS-27127 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-27129 [ JENKINS-27129 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 159542 ] JNJira + In-Review [ 196118 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: