Repository navigation
Add docker image provisioner test. - #3763
Merged
Merged
Conversation
sipsma
force-pushed
the
py-provision-test
branch
from
November 10, 2022 03:40
11676c3 to
4dc6ca5
Compare
Contributor
Author
|
I'm not sure what the linting error is, all I see it saying is: |
Contributor
|
Hope you don't mind that I modernized it a bit. You should do a |
Contributor
|
How is the docker provisioner adding to that temporary cache? Looks like the concurrency stuff isn't doing anything to affect Did you mean to set diff --git a/sdk/python/tests/connectors/test_docker.py b/sdk/python/tests/connectors/test_docker.py
index d19c4dcb..a845afac 100644
--- a/sdk/python/tests/connectors/test_docker.py
+++ b/sdk/python/tests/connectors/test_docker.py
@@ -15,7 +15,9 @@ pytestmark = [
dagger.Config().host.scheme != "docker-image",
reason="DAGGER_HOST is not docker-image",
)
-async def test_docker_image_provision(tmp_path: Path):
+async def test_docker_image_provision(tmp_path: Path, monkeypatch):
+ monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path))
+
cache_dir = tmp_path / "dagger"
cache_dir.mkdir()
|
Signed-off-by: Erik Sipsma <[email protected]>
- By using dagger.Config() instead of just os.environ we can test using the default value for DAGGER_HOST; - Temporary dirs should be created by a pytest fixture; - Use anyio instead of asyncio for compat with other backends like trio; Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
py-provision-test
branch
from
November 14, 2022 01:15
ba2163f to
85862fd
Compare
Contributor
Author
Yes! Thank you for noticing that and for the other cleanup commit @helderco ! I rebased, it should be good to go now. |
helderco
approved these changes
Nov 14, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Erik Sipsma [email protected]
Same thing as for Go, but in Python now: #3761
NOTE: this test won't yet run in CI because when we use dagger-in-dagger DAGGER_HOST gets overridden, so right now this test is only useful for us when running manually directly on hosts. I'm gonna fix this for both go+python+future-sdks in a follow up so it can also run in CI.
Also note: the ETXTBSY issue hit in Go (golang/go#22315) is not an issue here yet because our provisioner implementation is fully sync (and thus closes all file descriptors before they could end up in a forked process). However, that issue is a general Linux flaw and you can find people using pretty much any language hitting+complaining about it eventually across the internet, python example here.
So I think we will hit it if we update the provisioner to use async code, in which case this test case will start flaking and we can apply a similar fix that we did in Go (afaict doing a few retries after etxtbsy is where most people land as a solution).