Skip to content

Add test for docker image provision. - #3761

Merged
sipsma merged 2 commits into
dagger:mainfrom
sipsma:provision-test
Nov 10, 2022
Merged

sipsma merged 2 commits into
dagger:mainfrom
sipsma:provision-test

Conversation

@sipsma

@sipsma sipsma commented Nov 10, 2022 •

Copy link
Copy Markdown
Contributor

Main goal here is to automate provision testing. As part of that I found I was occasionally getting text busy errors trying to exec the engine-session binary.

After investigation this turned out to be incredibly obscure and highly specific to what the test case was doing. It could happen when:

  1. The engine-session binary was not already provisioned
  2. There are many fork/execs happening in parallel with the provisioning

It's actually a unsolved problem in Go and Linux in general apparently: golang/go#22315

It's a bit annoying to workaround but worth it so we can have this test case if nothing else.

@sipsma
sipsma requested a review from aluzzardi November 10, 2022 01:37
Comment thread sdk/go/provision_test.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@aluzzardi this is a case where the catch-22 we talked about before could happen: if we ever change this API then it won't work since this test case by default runs against a release engine.

I considered setting up what we talked about in terms of actually pushing the dev dagger engine to a local registry, but I'm not sure if it's worth it yet since we have open PRs changing how we build+test with that anyways, so I left it out of this PR for now. Let me know if you think it's worth an immediate fix though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I considered setting up what we talked about in terms of actually pushing the dev dagger engine to a local registry, but I'm not sure if it's worth it yet since we have open PRs changing how we build+test with that anyways, so I left it out of this PR for now. Let me know if you think it's worth an immediate fix though.

Yeah, sounds good, good for now

@sipsma
sipsma force-pushed the provision-test branch 2 times, most recently from e7b7bc8 to e8c699f Compare November 10, 2022 01:48
Comment thread sdk/go/go.mod Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

noooo it's back

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OMG good catch haha, it's cause I used the library they have for creating a random id (I think out of muscle memory from when I worked on that codebase more).

Will fix, can just use stdlib to get a random id.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should almost have a linter rule that fails if buildkit ends up in go.mod

FWIW -- I think this would have worked since the identity package is self contained (I don't see docker in go.mod/sum). Better safe than sorry though

The comment in startEngineSession has more details. It's incredibly
obscure but simple enough to fix that it's worth it.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma merged commit 51c7941 into dagger:main Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants