actions / runner-images

GitHub Actions runner images
MIT License
10.23k stars 3.08k forks source link

Tests using the .NET Docker remote API run indefinitely on Ubuntu 20.04 and Ubuntu 22.04 agents #6111

Closed Hornet-Nest closed 2 years ago

Hornet-Nest commented 2 years ago

Description

I have an integration test project that uses a library called Testcontainers to start an instance of a docker container for running tests against. The tests in this project pass on the Ubuntu 18.04 agent, however on updating to either Ubuntu 20.04 or 22.04 these tests now run up until the 1 hour build timeout is hit.

As the only change between a successful and failing build is updating the agent version in the yaml for the pipeline I believe that the issue is with the newer Ubuntu hosted agents.

Links to the last successful and failing builds can be found below.

Platforms affected

Virtual environments affected

Image version and build link

Failed builds:

Last successful build:

Is it regression?

Ubuntu 18.04

Expected behavior

All tests in the sample project (linked below) pass when run on an Ubuntu 20.04 / 22.04 hosted agent. The example that shows the issue can be found on the azure-pipelines branch.

https://dev.azure.com/hornetsnest/_git/TestContainers?path=%2F&version=GBazure-pipelines&_a=contents

Actual behavior

When run on an Ubuntu 20.04 or 22.04 agent the test step of the build runs up to the 1 hour limit. The build is then timed out. On an Ubuntu 18.04 agent this does not happen and the test step completes in roughly 2 minutes.

Repro steps

  1. Clone the linked repository into a new Azure DevOps project.
  2. Setup a build for the azure-pipelines branch using the azure-pipelines.yml in the repo.
  3. Run the build and see that it fails.
  4. Update the azure-pipelines.yml to use an Ubuntu 18.04 agent.
  5. Run the build and see that is passes.
miketimofeev commented 2 years ago

Hi @Hornet-Nest! We will take a look.

miketimofeev commented 2 years ago

@Hornet-Nest could you take a look at this issue https://github.com/actions/runner-images/issues/5036? This seems related to me but I could be wrong.

Hornet-Nest commented 2 years ago

@miketimofeev I'd say the 2 issues are related. Both are using the same container image (mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator) and in both cases the image works correctly on an Ubuntu 18.04 agent but not on 20.04 agent or newer.

I've not been able to check the logs output from the container on for the build that was run an Ubuntu 20.04 agent however I suspect they will be similar to what is shown in this comment (https://github.com/actions/runner-images/issues/5036#issuecomment-1035411800). Which would explain why the builds are being timed out as how I'm verifying that the container is ready to accept requests is to wait by waiting for the word Started to be output to the containers stdout log.

waszak commented 2 years ago

This is issue is also here mentioned https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/45

Probably the only way to fix this issue before they depracate ubuntu 18.04 is to upvote issues like that in both places.

They even have special email for issues like that that https://docs.microsoft.com/en-us/azure/cosmos-db/linux-emulator?tabs=sql-api%2Cssl-netstd21#report-an-emulator-issue

I tried to ask in this second place because "azure-cosmos-db-emulator-docker" repo doesn't seem active and development of linux emulator probably is somwhere else. Still I didn't get response.

miketimofeev commented 2 years ago

@Hornet-Nest @waszak I'm going to close this issue as an external one but please feel free to contact us if you need any help from our side. Thank you!