Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(agent/agentcontainers): recreate devcontainers concurrently#18042

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletionsagent/agent_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2188,14 +2188,14 @@ func TestAgent_DevcontainerRecreate(t *testing.T) {

t.Logf("Looking for container with label: devcontainer.local_folder=%s", workspaceFolder)

var containerdocker.APIContainers
var containercodersdk.WorkspaceAgentContainer
testutil.Eventually(ctx, t, func(context.Context) bool {
containers, err :=pool.Client.ListContainers(docker.ListContainersOptions{All: true})
resp, err :=conn.ListContainers(ctx)
if err != nil {
t.Logf("Error listing containers: %v", err)
return false
}
for _, c := rangecontainers {
for _, c := rangeresp.Containers {
t.Logf("Found container: %s with labels: %v", c.ID[:12], c.Labels)
if v, ok := c.Labels["devcontainer.local_folder"]; ok && v == workspaceFolder {
t.Logf("Found matching container: %s", c.ID[:12])
Expand All@@ -2205,7 +2205,7 @@ func TestAgent_DevcontainerRecreate(t *testing.T) {
}
return false
}, testutil.IntervalMedium, "no container with workspace folder label found")
defer func(containerdocker.APIContainers) {
defer func(containercodersdk.WorkspaceAgentContainer) {
// We can't rely on pool here because the container is not
// managed by it (it is managed by @devcontainer/cli).
err := pool.Client.RemoveContainer(docker.RemoveContainerOptions{
Expand All@@ -2225,7 +2225,7 @@ func TestAgent_DevcontainerRecreate(t *testing.T) {
// Invoke recreate to trigger the destruction and recreation of the
// devcontainer, we do it in a goroutine so we can process logs
// concurrently.
go func(containerdocker.APIContainers) {
go func(containercodersdk.WorkspaceAgentContainer) {
err := conn.RecreateDevcontainer(ctx, container.ID)
assert.NoError(t, err, "recreate devcontainer should succeed")
}(container)
Expand DownExpand Up@@ -2253,12 +2253,12 @@ waitForOutcomeLoop:

// Make sure the container exists and isn't the same as the old one.
testutil.Eventually(ctx, t, func(context.Context) bool {
containers, err :=pool.Client.ListContainers(docker.ListContainersOptions{All: true})
resp, err :=conn.ListContainers(ctx)
if err != nil {
t.Logf("Error listing containers: %v", err)
return false
}
for _, c := rangecontainers {
for _, c := rangeresp.Containers {
t.Logf("Found container: %s with labels: %v", c.ID[:12], c.Labels)
if v, ok := c.Labels["devcontainer.local_folder"]; ok && v == workspaceFolder {
if c.ID == container.ID {
Expand All@@ -2272,7 +2272,7 @@ waitForOutcomeLoop:
}
return false
}, testutil.IntervalMedium, "new devcontainer not found")
defer func(containerdocker.APIContainers) {
defer func(containercodersdk.WorkspaceAgentContainer) {
// We can't rely on pool here because the container is not
// managed by it (it is managed by @devcontainer/cli).
err := pool.Client.RemoveContainer(docker.RemoveContainerOptions{
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp