Skip to content

feat(agent/agentcontainers): update containers periodically #17972

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 11 commits into from
May 22, 2025
Prev Previous commit
Next Next commit
try to fix potential race in test
  • Loading branch information
mafredri committed May 21, 2025
commit 58b65a156d147222be63c34af2541efff025c08b
4 changes: 3 additions & 1 deletion agent/agentcontainers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ func TestAPI(t *testing.T) {
ID: "container-id",
FriendlyName: "container-name",
Running: true,
CreatedAt: time.Now(),
CreatedAt: time.Now().Add(-1 * time.Minute),
Labels: map[string]string{
agentcontainers.DevcontainerLocalFolderLabel: "/home/coder/project",
agentcontainers.DevcontainerConfigFileLabel: "/home/coder/project/.devcontainer/devcontainer.json",
Expand Down Expand Up @@ -771,6 +771,8 @@ func TestAPI(t *testing.T) {

ctx := testutil.Context(t, testutil.WaitShort)

clk.Set(time.Now()).MustWait(ctx)

// Simulate a file modification event to make the devcontainer dirty.
watcher.sendEventWaitNextCalled(ctx, fsnotify.Event{
Name: "/home/coder/project/.devcontainer/devcontainer.json",
Expand Down
Loading