1

Hanging pipeline

I used the following yml content. Used Azurite 3.15 and 3.9. But no luck. Then I tried as separate jobs. Still unable to pass the integration test.

 stages:
    - stage: Publish
      displayName: 'Build and Publish Artifacts'
      jobs:
      - job: 'NGKMediaManagementAPI'
        steps:
        - task: NodeTool@0 
          inputs:
             versionSpec: 13.x
        - script : npm install -g azurite@3.9.0
        - script : mkdir azurite
        - script : azurite
Nimantha
  • 6,405
  • 6
  • 28
  • 69

2 Answers2

3

Solved the hanging issue and Passed the Init tests(based on Azurite) in pipeline. use the following command in your yml file. Most importantly start /B azurite will remove the hanging issue !!!

 - task: NodeTool@0 
      inputs:
         versionSpec: 13.x
    - script : npm install -g azurite
      displayName: Install Azurite
    - script : start /B azurite
      displayName: Start azurite

below is success the pipeline enter image description here

0

When starting Azurite, the default is for it to block the command prompt you're running it on which makes the pipeline appear to hang.

Run the command from PowerShell and Use the background operator to start a background job.

- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: |
      npm install -g azurite
      azurite &

More information: Run automated tests by using Azurite - Run tests on Azure Pipelines. In this example they use the & operator in Bash which also directs the shell to run the command in the background.

Other interesting commands around this are Get-Job, Stop-Job and Remove-Job.

rickvdbosch
  • 14,105
  • 2
  • 40
  • 53
  • 1
    Thank you for your suggestion :) But when using azurite & I got issue as The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string. Then I used as azurite "&" . This resolve issue but still azurite up and hangs my pipeline. I am using Windows 2022 – Chathu.Thanthrige Feb 09 '22 at 08:57