Skip to content

chore(coderd/coderdtest): wait for provisioner daemons to be connected #15936

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
Dec 20, 2024

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Dec 19, 2024

@johnstcn johnstcn self-assigned this Dec 19, 2024
func AwaitProvisionerDaemonsConnected(t testing.TB, api *coderd.API) {
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
defer cancel()
for {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of this polling loop with potentially noisy logs, what if we made a slight addition to the provisionerd.Server such that it closes or sends on a buffered channel when it connects for the first time. This is how the tailnet dialer works.

Then we could select on that channel (vs ctx.Done()) rather than polling.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried this out, except at the provisionerd level itself. LMK if that suits, or I can circle back and do it in the provisionerd server as you suggested.

@johnstcn johnstcn merged commit 9e9a5fd into main Dec 20, 2024
30 checks passed
@johnstcn johnstcn deleted the cj/flake/await-provisioner-daemon-connected branch December 20, 2024 09:49
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flake: TestPostTemplateVersionsByOrganization/WithParameters
2 participants