Skip to content

Disable/fix docker tests failing after migration to GH Actions #12625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2025

Conversation

k-a-il
Copy link
Contributor

@k-a-il k-a-il commented May 15, 2025

Motivation

This PR is part of initiative to migrate from CircleCI to GH Actions. After migrating the full test run from CircleCI to GitHub Actions, some tests in the TestHooks and in the TestDockerClient class with parameter SdkDockerClient started failing.

Changes

  • test_is_container_running was failing because of race condition. This was fixed by adding retries
  • test_create_with_exposed_ports was failing for SdkDockerClient, skipping this test case for now. @dfangl will fix this test later
  • test_prepare_host_hook_called_with_correct_dirs - test was failing because the environment variableLOCALSTACK_INFRA_PROCESS was set to true, likely by another test. Since environment variables are part of the global state, this caused unexpected side effect. However, the value of LOCALSTACK_INFRA_PROCESS doesn’t seem relevant for this particular test, and we don't expect it to be set. To avoid this issue, I modified the code to return None instead of reading os.getenv("LOCALSTACK_INFRA_PROCESS") and removed the related assertion.

Testing

Tested here

@k-a-il k-a-il self-assigned this May 15, 2025
@k-a-il k-a-il added the semver: patch Non-breaking changes which can be included in patch releases label May 15, 2025
Copy link

github-actions bot commented May 15, 2025

LocalStack Community integration with Pro

2 files  2 suites   31s ⏱️
2 tests 0 ✅ 2 💤 0 ❌
4 runs  0 ✅ 4 💤 0 ❌

Results for commit 7100455.

♻️ This comment has been updated with latest results.

@k-a-il k-a-il changed the title Disable/fix docker tests failing after migration to GH Action Disable/fix docker tests failing after migration to GH Actions May 16, 2025
@k-a-il k-a-il requested review from silv-io and dfangl May 16, 2025 15:02
@k-a-il k-a-il marked this pull request as ready for review May 16, 2025 15:08
@k-a-il k-a-il requested review from thrau and alexrashed as code owners May 16, 2025 15:08
Copy link
Member

@silv-io silv-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'll let @dfangl pass final judgement on these changes though

Comment on lines +515 to +516
if isinstance(docker_client, SdkDockerClient):
pytest.skip("Test skipped for SdkDockerClient")
Copy link
Member

@silv-io silv-io May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Do we already know how this fix will look like and when it will be delivered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t have many details. When I asked @dfangl , he said the SDK client and the command-line client behave a bit differently, even though the API response should be the same. He plans to look into it when he has time

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python sdk sadly does not really allow us to send the exact same request as the docker cli would - so there is some difference in the output as well, and that difference might even change between API versions of docker.
A fix would be finding out the exact difference between the API requests of the CLI and the SDK, and then patching the sdk and filing an issue upstream.

Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fixes!

Comment on lines +515 to +516
if isinstance(docker_client, SdkDockerClient):
pytest.skip("Test skipped for SdkDockerClient")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python sdk sadly does not really allow us to send the exact same request as the docker cli would - so there is some difference in the output as well, and that difference might even change between API versions of docker.
A fix would be finding out the exact difference between the API requests of the CLI and the SDK, and then patching the sdk and filing an issue upstream.

@k-a-il k-a-il merged commit ada991e into master May 19, 2025
54 checks passed
@k-a-il k-a-il deleted the circle-ci-to-gh-fix-tests branch May 19, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants