actions / runner-images

GitHub Actions runner images
MIT License
10.09k stars 3.04k forks source link

Azurite Table emulator not working #7022

Closed jessejiang0214 closed 1 year ago

jessejiang0214 commented 1 year ago

Description

Check this issue https://github.com/Azure/Azurite/issues/1761 We found that some application takes the port of Azurite table services(port is 10002),

Platforms affected

Runner images affected

Image version and build link

20221215.2

Is it regression?

No

Expected behavior

The table services should run maybe with differnet port.

Actual behavior

The table services didn't run

Repro steps

You can test with any table sample code

bogdan-damian-bgd commented 1 year ago

Hello @jessejiang0214, we'll take a look at it.

sergei-pyshnoi commented 1 year ago

Hello @jessejiang0214 , can you provide more detailed repro steps? In the first look, we didn`t find that port 10002 is busy.

jessejiang0214 commented 1 year ago

Hi @sergei-pyshnoi ,

I'm spent some time on this issue. I found that this issue only can reproduce on Azure DevOps.

Here's github repo with action, which I try to reproduce this issue with minimum code. But it works fine. https://github.com/jessejiang0214/azurite-table-service-test/actions/runs/4070082791

When I used same code in Azure DevOps, it is not working.

Here's the YAML file in DevOps

trigger:
- main

pool:
  vmImage: windows-2022

steps:
- script: dotnet build
  displayName: 'build'

- script: start "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator\azurite.exe"
  displayName: 'Start azruite'

- script: dotnet test
  displayName: 'test'

You can use my code to test on DevOps and hope you can see the result.

sergei-pyshnoi commented 1 year ago

Hello, @jessejiang0214 . The main problem in separate steps 'Start azruite' and 'test' . In AZ Devops, the processes that launched in one step doesn`t shared with another. In your case, when testing is started, the azurite.exe process unavailable. Here is example where tests finished successfully:

trigger:
- main

pool:
  vmImage: windows-2022

steps:
- script: dotnet build
  displayName: 'build'

- script: |
    start /B "" "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator\azurite.exe"
    dotnet test
  displayName: 'Start azruite'

image

jessejiang0214 commented 1 year ago

Hi @sergei-pyshnoi ,

I just found the key thing is not separate steps. It's start /B "" I added this argument, and the old pipeline is working.

Thanks for your help.

Regards, Jesse